From 5e4454bf8ec0d4bdeee4ae85ae020eb1039e3211 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 30 Mar 2026 16:00:22 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...n.g.cs => ModerationAPI.AnyOf.3.Json.g.cs} | 22 +- ...nyOf.2.g.cs => ModerationAPI.AnyOf.3.g.cs} | 80 +- ...derationAPIClient.NewModerateModerate.g.cs | 8 +- ... ModerationAPI.JsonConverters.AnyOf3.g.cs} | 64 +- ...ateRequestPoliciePiiMaskingEntitiesId.g.cs | 53 - ...stPoliciePiiMaskingEntitiesIdNullable.g.cs | 60 - ...ateRequestPolicieUrlMaskingEntitiesId.g.cs | 53 - ...stPolicieUrlMaskingEntitiesIdNullable.g.cs | 60 - ...ModerationAPI.JsonConverters.OneOf26.g.cs} | 168 +- .../ModerationAPI.JsonConverters.OneOf5.g.cs | 314 + .../ModerationAPI.JsonSerializerContext.g.cs | 54 +- ...erationAPI.JsonSerializerContextTypes.g.cs | 104 +- ...API.Models.NewModerateModerateRequest.g.cs | 21 +- ...rateModerateRequestContentAudio.Json.g.cs} | 22 +- ...wModerateModerateRequestContentAudio.g.cs} | 10 +- ...rateModerateRequestContentImage.Json.g.cs} | 22 +- ...wModerateModerateRequestContentImage.g.cs} | 28 +- ...ModerateRequestContentObjectDataImage.g.cs | 18 +- ...erateModerateRequestContentText.Json.g.cs} | 22 +- ...ewModerateModerateRequestContentText.g.cs} | 10 +- ...rateModerateRequestContentVideo.Json.g.cs} | 22 +- ...wModerateModerateRequestContentVideo.g.cs} | 10 +- ...erateModerateRequestPolicieAdult.Json.g.cs | 92 + ...ewModerateModerateRequestPolicieAdult.g.cs | 63 + ...teModerateRequestPolicieCannabis.Json.g.cs | 92 + ...oderateModerateRequestPolicieCannabis.g.cs | 63 + ...derateModerateRequestPolicieCodeAbuse.g.cs | 9 + ...rateModerateRequestPolicieCrypto.Json.g.cs | 92 + ...wModerateModerateRequestPolicieCrypto.g.cs | 63 + ...erateModerateRequestPolicieFlirtation.g.cs | 9 + ...derateModerateRequestPolicieGuideline.g.cs | 9 + ...NewModerateModerateRequestPolicieHate.g.cs | 9 + ...ModerateModerateRequestPolicieIllicit.g.cs | 9 + ...eModerateRequestPolicieIllicitAlcohol.g.cs | 9 + ...ateModerateRequestPolicieIllicitDrugs.g.cs | 9 + ...ModerateRequestPolicieIllicitFirearms.g.cs | 9 + ...ModerateRequestPolicieIllicitGambling.g.cs | 9 + ...eModerateRequestPolicieIllicitTobacco.g.cs | 9 + ...rateRequestPoliciePersonalInformation.g.cs | 9 + ...rateRequestPoliciePiiMaskingEntities2.g.cs | 26 +- ...equestPoliciePiiMaskingEntities3.Json.g.cs | 92 + ...rateRequestPoliciePiiMaskingEntities3.g.cs | 18 + ...ateRequestPoliciePiiMaskingEntitiesId.g.cs | 93 - ...derateModerateRequestPoliciePolitical.g.cs | 9 + ...derateModerateRequestPolicieProfanity.g.cs | 9 + ...oderateModerateRequestPolicieReligion.g.cs | 9 + ...oderateModerateRequestPolicieSelfHarm.g.cs | 9 + ...teModerateRequestPolicieSelfPromotion.g.cs | 9 + ...wModerateModerateRequestPolicieSexual.g.cs | 9 + ...NewModerateModerateRequestPolicieSpam.g.cs | 9 + ...oderateModerateRequestPolicieToxicity.g.cs | 9 + ...eModerateRequestPolicieToxicitySevere.g.cs | 9 + ...rateRequestPolicieUrlMaskingEntities2.g.cs | 26 +- ...equestPolicieUrlMaskingEntities3.Json.g.cs | 92 + ...rateRequestPolicieUrlMaskingEntities3.g.cs | 18 + ...ateRequestPolicieUrlMaskingEntitiesId.g.cs | 93 - ...oderateModerateRequestPolicieViolence.g.cs | 9 + ...ls.NewModerateModerateResponseContent.g.cs | 4 +- ...ant1ModifiedNestedObjectContent.Json.g.cs} | 22 +- ...edVariant1ModifiedNestedObjectContent.g.cs | 18 + ...ModifiedNestedObjectContentAudio.Json.g.cs | 92 + ...ant1ModifiedNestedObjectContentAudio.g.cs} | 10 +- ...ModifiedNestedObjectContentImage.Json.g.cs | 92 + ...ant1ModifiedNestedObjectContentImage.g.cs} | 28 +- ...ModifiedNestedObjectContentText.Json.g.cs} | 22 +- ...iant1ModifiedNestedObjectContentText.g.cs} | 10 +- ...ModifiedNestedObjectContentVideo.Json.g.cs | 92 + ...ant1ModifiedNestedObjectContentVideo.g.cs} | 10 +- ...edVariant1ModifiedObjectContent.Json.g.cs} | 22 +- ...odifiedVariant1ModifiedObjectContent.g.cs} | 2 +- ...dVariant1ModifiedObjectContent2.Json.g.cs} | 22 +- ...odifiedVariant1ModifiedObjectContent2.g.cs | 18 + ...onseContentModifiedVariant1Video.Json.g.cs | 92 - ...erateResponseRecommendationReasonCode.g.cs | 12 + ...derationAPIClient.NewModerateModerate.g.cs | 9 +- ....g.cs => ModerationAPI.OneOf.26.Json.g.cs} | 22 +- ...Of.23.g.cs => ModerationAPI.OneOf.26.g.cs} | 268 +- .../Generated/ModerationAPI.OneOf.5.Json.g.cs | 92 + .../Generated/ModerationAPI.OneOf.5.g.cs | 376 + src/libs/ModerationAPI/openapi.yaml | 17374 +++++++++------- 80 files changed, 12890 insertions(+), 8156 deletions(-) rename src/libs/ModerationAPI/Generated/{ModerationAPI.AnyOf.2.Json.g.cs => ModerationAPI.AnyOf.3.Json.g.cs} (87%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.AnyOf.2.g.cs => ModerationAPI.AnyOf.3.g.cs} (65%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.JsonConverters.AnyOf2.g.cs => ModerationAPI.JsonConverters.AnyOf3.g.cs} (70%) delete mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesId.g.cs delete mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdNullable.g.cs delete mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesId.g.cs delete mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdNullable.g.cs rename src/libs/ModerationAPI/Generated/{ModerationAPI.JsonConverters.OneOf23.g.cs => ModerationAPI.JsonConverters.OneOf26.g.cs} (88%) create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf5.g.cs rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateRequestContentContentLeafText.Json.g.cs => ModerationAPI.Models.NewModerateModerateRequestContentAudio.Json.g.cs} (89%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateRequestContentContentLeafAudio.g.cs => ModerationAPI.Models.NewModerateModerateRequestContentAudio.g.cs} (86%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateRequestContentContentLeafVideo.Json.g.cs => ModerationAPI.Models.NewModerateModerateRequestContentImage.Json.g.cs} (89%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateRequestContentContentLeafImage.g.cs => ModerationAPI.Models.NewModerateModerateRequestContentImage.g.cs} (69%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateRequestContentContentLeafImage.Json.g.cs => ModerationAPI.Models.NewModerateModerateRequestContentText.Json.g.cs} (89%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateRequestContentContentLeafText.g.cs => ModerationAPI.Models.NewModerateModerateRequestContentText.g.cs} (86%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateRequestContentContentLeafAudio.Json.g.cs => ModerationAPI.Models.NewModerateModerateRequestContentVideo.Json.g.cs} (89%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateRequestContentContentLeafVideo.g.cs => ModerationAPI.Models.NewModerateModerateRequestContentVideo.g.cs} (86%) create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieAdult.Json.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieAdult.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCannabis.Json.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCannabis.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCrypto.Json.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCrypto.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities3.Json.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities3.g.cs delete mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntitiesId.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities3.Json.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities3.g.cs delete mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntitiesId.g.cs rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Image.Json.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent.Json.g.cs} (89%) create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio.Json.g.cs rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Audio.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio.g.cs} (86%) create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage.Json.g.cs rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Image.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage.g.cs} (68%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Text.Json.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText.Json.g.cs} (88%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Text.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText.g.cs} (86%) create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo.Json.g.cs rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Video.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo.g.cs} (86%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1.Json.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent.Json.g.cs} (90%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent.g.cs} (93%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Audio.Json.g.cs => ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2.Json.g.cs} (89%) create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2.g.cs delete mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Video.Json.g.cs rename src/libs/ModerationAPI/Generated/{ModerationAPI.OneOf.23.Json.g.cs => ModerationAPI.OneOf.26.Json.g.cs} (92%) rename src/libs/ModerationAPI/Generated/{ModerationAPI.OneOf.23.g.cs => ModerationAPI.OneOf.26.g.cs} (66%) create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.5.Json.g.cs create mode 100644 src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.5.g.cs diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.3.Json.g.cs similarity index 87% rename from src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.3.Json.g.cs index 44ea487..12a88a3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.3.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public readonly partial struct AnyOf + public readonly partial struct AnyOf { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.AnyOf? 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.AnyOf), - jsonSerializerContext) as global::ModerationAPI.AnyOf?; + typeof(global::ModerationAPI.AnyOf), + jsonSerializerContext) as global::ModerationAPI.AnyOf?; } /// @@ -51,11 +51,11 @@ 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.AnyOf? FromJson( + public static global::ModerationAPI.AnyOf? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize>( + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.AnyOf), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.AnyOf?; + typeof(global::ModerationAPI.AnyOf), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.AnyOf?; } /// @@ -80,11 +80,11 @@ 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) { - 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.3.g.cs similarity index 65% rename from src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.3.g.cs index 5b69be5..ef3a614 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.2.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.AnyOf.3.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public readonly partial struct AnyOf : global::System.IEquatable> + public readonly partial struct AnyOf : global::System.IEquatable> { /// /// @@ -41,15 +41,32 @@ namespace ModerationAPI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public T3? Value3 { get; init; } +#else + public T3? Value3 { get; } +#endif + /// /// /// - public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] +#endif + public bool IsValue3 => Value3 != null; + /// + /// + /// + public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); /// /// /// - public static implicit operator T1?(AnyOf @this) => @this.Value1; + public static implicit operator T1?(AnyOf @this) => @this.Value1; /// /// @@ -62,12 +79,12 @@ public AnyOf(T1? value) /// /// /// - public static implicit operator AnyOf(T2 value) => new AnyOf((T2?)value); + public static implicit operator AnyOf(T2 value) => new AnyOf((T2?)value); /// /// /// - public static implicit operator T2?(AnyOf @this) => @this.Value2; + public static implicit operator T2?(AnyOf @this) => @this.Value2; /// /// @@ -77,22 +94,43 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static implicit operator AnyOf(T3 value) => new AnyOf((T3?)value); + + /// + /// + /// + public static implicit operator T3?(AnyOf @this) => @this.Value3; + + /// + /// + /// + public AnyOf(T3? value) + { + Value3 = value; + } + /// /// /// public AnyOf( T1? value1, - T2? value2 + T2? value2, + T3? value3 ) { Value1 = value1; Value2 = value2; + Value3 = value3; } /// /// /// public object? Object => + Value3 as object ?? Value2 as object ?? Value1 as object ; @@ -102,7 +140,8 @@ Value1 as object /// public override string? ToString() => Value1?.ToString() ?? - Value2?.ToString() + Value2?.ToString() ?? + Value3?.ToString() ; /// @@ -110,7 +149,7 @@ Value1 as object /// public bool Validate() { - return IsValue1 || IsValue2; + return IsValue1 || IsValue2 || IsValue3; } /// @@ -119,6 +158,7 @@ public bool Validate() public TResult? Match( global::System.Func? value1 = null, global::System.Func? value2 = null, + global::System.Func? value3 = null, bool validate = true) { if (validate) @@ -134,6 +174,10 @@ public bool Validate() { return value2(Value2!); } + else if (IsValue3 && value3 != null) + { + return value3(Value3!); + } return default(TResult); } @@ -144,6 +188,7 @@ public bool Validate() public void Match( global::System.Action? value1 = null, global::System.Action? value2 = null, + global::System.Action? value3 = null, bool validate = true) { if (validate) @@ -159,6 +204,10 @@ public void Match( { value2?.Invoke(Value2!); } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } } /// @@ -172,6 +221,8 @@ public override int GetHashCode() typeof(T1), Value2, typeof(T2), + Value3, + typeof(T3), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -185,26 +236,27 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null /// /// /// - public bool Equals(AnyOf other) + 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) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) ; } /// /// /// - public static bool operator ==(AnyOf obj1, AnyOf obj2) + public static bool operator ==(AnyOf obj1, AnyOf 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 !=(AnyOf obj1, AnyOf obj2) + public static bool operator !=(AnyOf obj1, AnyOf obj2) { return !(obj1 == obj2); } @@ -214,7 +266,7 @@ public bool Equals(AnyOf other) /// public override bool Equals(object? obj) { - return obj is AnyOf o && Equals(o); + return obj is AnyOf o && Equals(o); } } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs index fc7241a..66612a3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.IModerationAPIClient.NewModerateModerate.g.cs @@ -28,6 +28,9 @@ public partial interface IModerationAPIClient /// /// The content sent for moderation /// + /// + /// Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. + /// /// /// Provide a channel ID or key. Will use the project's default channel if not provided. /// @@ -55,7 +58,8 @@ public partial interface IModerationAPIClient /// The token to cancel the operation with /// global::System.Threading.Tasks.Task NewModerateModerateAsync( - global::ModerationAPI.OneOf?, global::ModerationAPI.NewModerateModerateRequestContentObject> content, + global::ModerationAPI.OneOf content, + double? timestamp = default, string? channel = default, string? contentId = default, global::ModerationAPI.NewModerateModerateRequestMetaType? metaType = default, @@ -63,7 +67,7 @@ public partial interface IModerationAPIClient string? conversationId = default, object? metadata = default, bool? doNotStore = default, - global::System.Collections.Generic.IList>? policies = default, + global::System.Collections.Generic.IList>? policies = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ 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.AnyOf3.g.cs similarity index 70% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.AnyOf2.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.AnyOf3.g.cs index 80562d7..5c7db7b 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.AnyOf2.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.AnyOf3.g.cs @@ -3,10 +3,10 @@ namespace ModerationAPI.JsonConverters { /// - public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> { /// - public override global::ModerationAPI.AnyOf Read( + public override global::ModerationAPI.AnyOf Read( ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) @@ -48,13 +48,26 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serialization } } } + var __score2 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), 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)) __score2++; + } + } + } var __bestScore = 0; var __bestIndex = -1; if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } T1? value1 = default; T2? value2 = default; + T3? value3 = default; if (__bestIndex >= 0) { if (__bestIndex == 0) @@ -90,9 +103,26 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serialization { } } + + else if (__bestIndex == 2) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } } - if (value1 == null && value2 == null) + if (value1 == null && value2 == null && value3 == null) { try { @@ -121,12 +151,28 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serialization catch (global::System.InvalidOperationException) { } + + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } } - var __value = new global::ModerationAPI.AnyOf( + var __value = new global::ModerationAPI.AnyOf( value1, - value2 + value2, + + value3 ); return __value; @@ -135,7 +181,7 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serialization /// public override void Write( global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.AnyOf value, + global::ModerationAPI.AnyOf value, global::System.Text.Json.JsonSerializerOptions options) { options = options ?? throw new global::System.ArgumentNullException(nameof(options)); @@ -153,6 +199,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeInfo); } + else if (value.IsValue3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3, typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesId.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesId.g.cs deleted file mode 100644 index aa7efdf..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesId.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class NewModerateModerateRequestPoliciePiiMaskingEntitiesIdJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId 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.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdNullable.g.cs deleted file mode 100644 index 0980c4c..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class NewModerateModerateRequestPoliciePiiMaskingEntitiesIdNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId? 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.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId? 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.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesId.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesId.g.cs deleted file mode 100644 index f208691..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesId.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class NewModerateModerateRequestPolicieUrlMaskingEntitiesIdJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId 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.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdNullable.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdNullable.g.cs deleted file mode 100644 index 1c53642..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace ModerationAPI.JsonConverters -{ - /// - public sealed class NewModerateModerateRequestPolicieUrlMaskingEntitiesIdNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId? 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.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId? 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.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf23.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf26.g.cs similarity index 88% rename from src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf23.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf26.g.cs index d6e83e0..fb23409 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf23.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf26.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) @@ -279,6 +279,39 @@ public class OneOfJsonConverter __bestScore) { __bestScore = __score0; __bestIndex = 0; } @@ -304,6 +337,9 @@ public class OneOfJsonConverter __bestScore) { __bestScore = __score20; __bestIndex = 20; } if (__score21 > __bestScore) { __bestScore = __score21; __bestIndex = 21; } if (__score22 > __bestScore) { __bestScore = __score22; __bestIndex = 22; } + if (__score23 > __bestScore) { __bestScore = __score23; __bestIndex = 23; } + if (__score24 > __bestScore) { __bestScore = __score24; __bestIndex = 24; } + if (__score25 > __bestScore) { __bestScore = __score25; __bestIndex = 25; } T1? value1 = default; T2? value2 = default; @@ -328,6 +364,9 @@ public class OneOfJsonConverter= 0) { if (__bestIndex == 0) @@ -720,9 +759,60 @@ public class OneOfJsonConverter ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T24).Name}"); + value24 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 24) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T25), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T25).Name}"); + value25 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 25) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T26), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T26).Name}"); + value26 = 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) + 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) { try { @@ -1045,9 +1135,51 @@ public class OneOfJsonConverter ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T24).Name}"); + value24 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T25), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T25).Name}"); + value25 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T26), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T26).Name}"); + value26 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } } - var __value = new global::ModerationAPI.OneOf( + var __value = new global::ModerationAPI.OneOf( value1, value2, @@ -1092,7 +1224,13 @@ 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)); @@ -1245,6 +1383,24 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T23).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value23, typeInfo); } + else if (value.IsValue24) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T24), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T24).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value24, typeInfo); + } + else if (value.IsValue25) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T25), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T25).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value25, typeInfo); + } + else if (value.IsValue26) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T26), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T26).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value26, typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf5.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf5.g.cs new file mode 100644 index 0000000..f733c78 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonConverters.OneOf5.g.cs @@ -0,0 +1,314 @@ +#nullable enable + +namespace ModerationAPI.JsonConverters +{ + /// + public class OneOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::ModerationAPI.OneOf 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 __score2 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), 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)) __score2++; + } + } + } + var __score3 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T4), 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)) __score3++; + } + } + } + var __score4 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T5), 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)) __score4++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } + if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; } + + T1? value1 = default; + T2? value2 = default; + T3? value3 = default; + T4? value4 = default; + T5? value5 = 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) + { + } + } + + else if (__bestIndex == 2) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 3) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 4) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + value5 = 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) + { + 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) + { + } + + 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) + { + } + + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + value5 = 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, + + value3, + + value4, + + value5 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::ModerationAPI.OneOf 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.Value1, 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.Value2, typeInfo); + } + else if (value.IsValue3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3, typeInfo); + } + else if (value.IsValue4) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4, typeInfo); + } + else if (value.IsValue5) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs index ec273ac..ee3e2ac 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContext.g.cs @@ -49,14 +49,6 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestMetaTypeNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdNullableJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdJsonConverter), - - typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.AuthorOpenListAuthorsSortByJsonConverter), typeof(global::ModerationAPI.JsonConverters.AuthorOpenListAuthorsSortByNullableJsonConverter), @@ -237,13 +229,11 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.NewModerateModerateResponseMetaStatusNullableJsonConverter), - typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter?, global::ModerationAPI.NewModerateModerateRequestContentObject>), - - typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), + typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), - typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), + typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), typeof(global::ModerationAPI.JsonConverters.AllOfJsonConverter), @@ -251,9 +241,9 @@ namespace ModerationAPI typeof(global::ModerationAPI.JsonConverters.AllOfJsonConverter), - typeof(global::ModerationAPI.JsonConverters.AnyOfJsonConverter>>), + typeof(global::ModerationAPI.JsonConverters.AnyOfJsonConverter>>), - typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), + typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter), @@ -322,12 +312,11 @@ namespace ModerationAPI [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))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf?, global::ModerationAPI.NewModerateModerateRequestContentObject>), TypeInfoPropertyName = "OneOfOneOfNewModerateModerateRequestContentContentLeafTextNewModerateModerateRequestContentContentLeafImageNewModerateModerateRequestContentContentLeafVideoNewModerateModerateRequestContentContentLeafAudioNewModerateModerateRequestContentObject2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "OneOfNewModerateModerateRequestContentContentLeafTextNewModerateModerateRequestContentContentLeafImageNewModerateModerateRequestContentContentLeafVideoNewModerateModerateRequestContentContentLeafAudio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentContentLeafText))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentContentLeafImage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentContentLeafVideo))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentContentLeafAudio))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "OneOfNewModerateModerateRequestContentTextNewModerateModerateRequestContentImageNewModerateModerateRequestContentVideoNewModerateModerateRequestContentAudioNewModerateModerateRequestContentObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentText))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentImage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentVideo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentAudio))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentObject))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "OneOfNewModerateModerateRequestContentObjectDataTextNewModerateModerateRequestContentObjectDataImageNewModerateModerateRequestContentObjectDataVideoNewModerateModerateRequestContentObjectDataAudio2")] @@ -336,8 +325,8 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentObjectDataVideo))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestContentObjectDataAudio))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestMetaType), TypeInfoPropertyName = "NewModerateModerateRequestMetaType2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "OneOfNewModerateModerateRequestPolicieToxicityNewModerateModerateRequestPoliciePersonalInformationNewModerateModerateRequestPolicieToxicitySevereNewModerateModerateRequestPolicieHateNewModerateModerateRequestPolicieIllicitNewModerateModerateRequestPolicieIllicitDrugsNewModerateModerateRequestPolicieIllicitAlcoholNewModerateModerateRequestPolicieIllicitFirearmsNewModerateModerateRequestPolicieIllicitTobaccoNewModerateModerateRequestPolicieIllicitGamblingNewModerateModerateRequestPolicieSexualNewModerateModerateRequestPolicieFlirtationNewModerateModerateRequestPolicieProfanityNewModerateModerateRequestPolicieViolenceNewModerateModerateRequestPolicieSelfHarmNewModerateModerateRequestPolicieSpamNewModerateModerateRequestPolicieSelfPromotionNewModerateModerateRequestPoliciePoliticalNewModerateModerateRequestPolicieReligionNewModerateModerateRequestPolicieCodeAbuseNewModerateModerateRequestPoliciePiiMaskingNewModerateModerateRequestPolicieUrlMaskingNewModerateModerateRequestPolicieGuideline2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "OneOfNewModerateModerateRequestPolicieToxicityNewModerateModerateRequestPoliciePersonalInformationNewModerateModerateRequestPolicieToxicitySevereNewModerateModerateRequestPolicieHateNewModerateModerateRequestPolicieIllicitNewModerateModerateRequestPolicieIllicitDrugsNewModerateModerateRequestPolicieIllicitAlcoholNewModerateModerateRequestPolicieIllicitFirearmsNewModerateModerateRequestPolicieIllicitTobaccoNewModerateModerateRequestPolicieIllicitGamblingNewModerateModerateRequestPolicieCannabisNewModerateModerateRequestPolicieAdultNewModerateModerateRequestPolicieCryptoNewModerateModerateRequestPolicieSexualNewModerateModerateRequestPolicieFlirtationNewModerateModerateRequestPolicieProfanityNewModerateModerateRequestPolicieViolenceNewModerateModerateRequestPolicieSelfHarmNewModerateModerateRequestPolicieSpamNewModerateModerateRequestPolicieSelfPromotionNewModerateModerateRequestPoliciePoliticalNewModerateModerateRequestPolicieReligionNewModerateModerateRequestPolicieCodeAbuseNewModerateModerateRequestPoliciePiiMaskingNewModerateModerateRequestPolicieUrlMaskingNewModerateModerateRequestPolicieGuideline2")] [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))] @@ -348,6 +337,9 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieIllicitFirearms))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieIllicitTobacco))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieIllicitGambling))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieCannabis))] + [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.NewModerateModerateRequestPolicieFlirtation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieProfanity))] @@ -361,11 +353,9 @@ namespace ModerationAPI [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))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId), TypeInfoPropertyName = "NewModerateModerateRequestPoliciePiiMaskingEntitiesId2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUrlMasking))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId), TypeInfoPropertyName = "NewModerateModerateRequestPolicieUrlMaskingEntitiesId2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateRequestPolicieGuideline))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorOpenListAuthorsSortBy), TypeInfoPropertyName = "AuthorOpenListAuthorsSortBy2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AuthorOpenListAuthorsSortDirection), TypeInfoPropertyName = "AuthorOpenListAuthorsSortDirection2")] @@ -556,13 +546,13 @@ namespace ModerationAPI [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.WordlistRemoveWordsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContent))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AnyOf>>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "OneOfNewModerateModerateResponseContentModifiedVariant1TextNewModerateModerateResponseContentModifiedVariant1ImageNewModerateModerateResponseContentModifiedVariant1VideoNewModerateModerateResponseContentModifiedVariant1Audio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Text))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Image))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Video))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Audio))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.AnyOf>>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.OneOf), TypeInfoPropertyName = "OneOfNewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentTextNewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImageNewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideoNewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseAuthor2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseAuthorBlock2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::ModerationAPI.NewModerateModerateResponseAuthorStatus), TypeInfoPropertyName = "NewModerateModerateResponseAuthorStatus2")] @@ -602,7 +592,7 @@ 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))] diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs index 5ddd056..e0688fa 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.JsonSerializerContextTypes.g.cs @@ -268,179 +268,179 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::ModerationAPI.OneOf?, global::ModerationAPI.NewModerateModerateRequestContentObject>? Type60 { get; set; } + public global::ModerationAPI.OneOf? Type60 { get; set; } /// /// /// - public global::ModerationAPI.OneOf? Type61 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentText? Type61 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentContentLeafText? Type62 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentImage? Type62 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentContentLeafImage? Type63 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentVideo? Type63 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentContentLeafVideo? Type64 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentAudio? Type64 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentContentLeafAudio? Type65 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObject? Type65 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObject? Type66 { get; set; } + public global::System.Collections.Generic.Dictionary>? Type66 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? Type67 { get; set; } + public global::ModerationAPI.OneOf? Type67 { get; set; } /// /// /// - public global::ModerationAPI.OneOf? Type68 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataText? Type68 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataText? Type69 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataImage? Type69 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataImage? Type70 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataVideo? Type70 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataVideo? Type71 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestContentObjectDataAudio? Type71 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestContentObjectDataAudio? Type72 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestMetaType? Type72 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestMetaType? Type73 { get; set; } + public global::System.Collections.Generic.IList>? Type73 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type74 { get; set; } + public global::ModerationAPI.OneOf? Type74 { get; set; } /// /// /// - public global::ModerationAPI.OneOf? Type75 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieToxicity? Type75 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieToxicity? Type76 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePersonalInformation? Type76 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePersonalInformation? Type77 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieToxicitySevere? Type77 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieToxicitySevere? Type78 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieHate? Type78 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieHate? Type79 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicit? Type79 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicit? Type80 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitDrugs? Type80 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitDrugs? Type81 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitAlcohol? Type81 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitAlcohol? Type82 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitFirearms? Type82 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitFirearms? Type83 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitTobacco? Type83 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitTobacco? Type84 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitGambling? Type84 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieIllicitGambling? Type85 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCannabis? Type85 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSexual? Type86 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieAdult? Type86 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieFlirtation? Type87 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCrypto? Type87 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieProfanity? Type88 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSexual? Type88 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieViolence? Type89 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieFlirtation? Type89 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSelfHarm? Type90 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieProfanity? Type90 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSpam? Type91 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieViolence? Type91 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieSelfPromotion? Type92 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSelfHarm? Type92 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePolitical? Type93 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSpam? Type93 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieReligion? Type94 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieSelfPromotion? Type94 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieCodeAbuse? Type95 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePolitical? Type95 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMasking? Type96 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieReligion? Type96 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type97 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieCodeAbuse? Type97 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities2? Type98 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMasking? Type98 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId? Type99 { get; set; } + public global::System.Collections.Generic.Dictionary? Type99 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMasking? Type100 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities2? Type100 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type101 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMasking? Type101 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities2? Type102 { get; set; } + public global::System.Collections.Generic.Dictionary? Type102 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId? Type103 { get; set; } + public global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities2? Type103 { get; set; } /// /// /// @@ -1204,31 +1204,31 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::ModerationAPI.AnyOf>>? Type294 { get; set; } + public global::ModerationAPI.AnyOf>>? Type294 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? Type295 { get; set; } + public global::System.Collections.Generic.Dictionary>? Type295 { get; set; } /// /// /// - public global::ModerationAPI.OneOf? Type296 { get; set; } + public global::ModerationAPI.OneOf? Type296 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Text? Type297 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText? Type297 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Image? Type298 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage? Type298 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Video? Type299 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo? Type299 { get; set; } /// /// /// - public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Audio? Type300 { get; set; } + public global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio? Type300 { get; set; } /// /// /// @@ -1389,7 +1389,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List>? ListType11 { get; set; } + public global::System.Collections.Generic.List>? ListType11 { get; set; } /// /// /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequest.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequest.g.cs index 967f612..c96ee55 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequest.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequest.g.cs @@ -12,9 +12,15 @@ public sealed partial class NewModerateModerateRequest /// The content sent for moderation /// [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter?, global::ModerationAPI.NewModerateModerateRequestContentObject>))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.OneOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.OneOf?, global::ModerationAPI.NewModerateModerateRequestContentObject> Content { get; set; } + public required global::ModerationAPI.OneOf Content { get; set; } + + /// + /// Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timestamp")] + public double? Timestamp { get; set; } /// /// Provide a channel ID or key. Will use the project's default channel if not provided. @@ -63,7 +69,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 @@ -77,6 +83,9 @@ public sealed partial class NewModerateModerateRequest /// /// The content sent for moderation /// + /// + /// Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. + /// /// /// Provide a channel ID or key. Will use the project's default channel if not provided. /// @@ -105,7 +114,8 @@ public sealed partial class NewModerateModerateRequest [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequest( - global::ModerationAPI.OneOf?, global::ModerationAPI.NewModerateModerateRequestContentObject> content, + global::ModerationAPI.OneOf content, + double? timestamp, string? channel, string? contentId, global::ModerationAPI.NewModerateModerateRequestMetaType? metaType, @@ -113,9 +123,10 @@ public NewModerateModerateRequest( string? conversationId, object? metadata, bool? doNotStore, - global::System.Collections.Generic.IList>? policies) + global::System.Collections.Generic.IList>? policies) { this.Content = content; + this.Timestamp = timestamp; this.Channel = channel; this.ContentId = contentId; this.MetaType = metaType; diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafText.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentAudio.Json.g.cs similarity index 89% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafText.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentAudio.Json.g.cs index 3353059..49ad517 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafText.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentAudio.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class NewModerateModerateRequestContentContentLeafText + public sealed partial class NewModerateModerateRequestContentAudio { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.NewModerateModerateRequestContentContentLeafText? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestContentAudio? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.NewModerateModerateRequestContentContentLeafText), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestContentContentLeafText; + typeof(global::ModerationAPI.NewModerateModerateRequestContentAudio), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestContentAudio; } /// @@ -51,11 +51,11 @@ 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.NewModerateModerateRequestContentContentLeafText? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestContentAudio? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.NewModerateModerateRequestContentContentLeafText), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestContentContentLeafText; + typeof(global::ModerationAPI.NewModerateModerateRequestContentAudio), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestContentAudio; } /// @@ -80,11 +80,11 @@ 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) { - 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.NewModerateModerateRequestContentContentLeafAudio.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentAudio.g.cs similarity index 86% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafAudio.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentAudio.g.cs index f449c84..08aa1a9 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafAudio.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentAudio.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Audio /// - public sealed partial class NewModerateModerateRequestContentContentLeafAudio + public sealed partial class NewModerateModerateRequestContentAudio { /// /// @@ -29,7 +29,7 @@ public sealed partial class NewModerateModerateRequestContentContentLeafAudio 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 URL of the audio content @@ -38,7 +38,7 @@ public sealed partial class NewModerateModerateRequestContentContentLeafAudio #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public NewModerateModerateRequestContentContentLeafAudio( + public NewModerateModerateRequestContentAudio( string url, string type = "audio") { @@ -47,9 +47,9 @@ public NewModerateModerateRequestContentContentLeafAudio( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public NewModerateModerateRequestContentContentLeafAudio() + public NewModerateModerateRequestContentAudio() { } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafVideo.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentImage.Json.g.cs similarity index 89% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafVideo.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentImage.Json.g.cs index 0460c54..77d2ab3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafVideo.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentImage.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class NewModerateModerateRequestContentContentLeafVideo + public sealed partial class NewModerateModerateRequestContentImage { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.NewModerateModerateRequestContentContentLeafVideo? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestContentImage? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.NewModerateModerateRequestContentContentLeafVideo), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestContentContentLeafVideo; + typeof(global::ModerationAPI.NewModerateModerateRequestContentImage), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestContentImage; } /// @@ -51,11 +51,11 @@ 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.NewModerateModerateRequestContentContentLeafVideo? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestContentImage? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.NewModerateModerateRequestContentContentLeafVideo), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestContentContentLeafVideo; + typeof(global::ModerationAPI.NewModerateModerateRequestContentImage), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestContentImage; } /// @@ -80,11 +80,11 @@ 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) { - 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.NewModerateModerateRequestContentContentLeafImage.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentImage.g.cs similarity index 69% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafImage.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentImage.g.cs index 635f508..594afd3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafImage.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentImage.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Image /// - public sealed partial class NewModerateModerateRequestContentContentLeafImage + public sealed partial class NewModerateModerateRequestContentImage { /// /// @@ -19,8 +19,13 @@ public sealed partial class NewModerateModerateRequestContentContentLeafImage /// A public URL of the image content /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } + public string? Url { get; set; } + + /// + /// Base64-encoded image data + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,27 +34,32 @@ public sealed partial class NewModerateModerateRequestContentContentLeafImage 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. /// /// /// A public URL of the image content /// + /// + /// Base64-encoded image data + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public NewModerateModerateRequestContentContentLeafImage( - string url, + public NewModerateModerateRequestContentImage( + string? url, + string? data, string type = "image") { this.Type = type; - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.Url = url; + this.Data = data; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public NewModerateModerateRequestContentContentLeafImage() + public NewModerateModerateRequestContentImage() { } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentObjectDataImage.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentObjectDataImage.g.cs index af574cc..d7adfdb 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentObjectDataImage.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentObjectDataImage.g.cs @@ -19,8 +19,13 @@ public sealed partial class NewModerateModerateRequestContentObjectDataImage /// A public URL of the image content /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } + public string? Url { get; set; } + + /// + /// Base64-encoded image data + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -34,16 +39,21 @@ public sealed partial class NewModerateModerateRequestContentObjectDataImage /// /// A public URL of the image content /// + /// + /// Base64-encoded image data + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestContentObjectDataImage( - string url, + string? url, + string? data, string type = "image") { this.Type = type; - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.Url = url; + this.Data = data; } /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafImage.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentText.Json.g.cs similarity index 89% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafImage.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentText.Json.g.cs index 10d13c0..bb008ca 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafImage.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentText.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class NewModerateModerateRequestContentContentLeafImage + public sealed partial class NewModerateModerateRequestContentText { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.NewModerateModerateRequestContentContentLeafImage? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestContentText? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.NewModerateModerateRequestContentContentLeafImage), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestContentContentLeafImage; + typeof(global::ModerationAPI.NewModerateModerateRequestContentText), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestContentText; } /// @@ -51,11 +51,11 @@ 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.NewModerateModerateRequestContentContentLeafImage? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestContentText? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.NewModerateModerateRequestContentContentLeafImage), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestContentContentLeafImage; + typeof(global::ModerationAPI.NewModerateModerateRequestContentText), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestContentText; } /// @@ -80,11 +80,11 @@ 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) { - 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.NewModerateModerateRequestContentContentLeafText.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentText.g.cs similarity index 86% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafText.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentText.g.cs index 79818e6..c24b2f5 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafText.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentText.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Text /// - public sealed partial class NewModerateModerateRequestContentContentLeafText + public sealed partial class NewModerateModerateRequestContentText { /// /// @@ -29,7 +29,7 @@ public sealed partial class NewModerateModerateRequestContentContentLeafText 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 content text @@ -38,7 +38,7 @@ public sealed partial class NewModerateModerateRequestContentContentLeafText #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public NewModerateModerateRequestContentContentLeafText( + public NewModerateModerateRequestContentText( string text, string type = "text") { @@ -47,9 +47,9 @@ public NewModerateModerateRequestContentContentLeafText( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public NewModerateModerateRequestContentContentLeafText() + public NewModerateModerateRequestContentText() { } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafAudio.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentVideo.Json.g.cs similarity index 89% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafAudio.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentVideo.Json.g.cs index c2f3e98..8812ba3 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafAudio.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentVideo.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class NewModerateModerateRequestContentContentLeafAudio + public sealed partial class NewModerateModerateRequestContentVideo { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.NewModerateModerateRequestContentContentLeafAudio? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestContentVideo? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.NewModerateModerateRequestContentContentLeafAudio), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestContentContentLeafAudio; + typeof(global::ModerationAPI.NewModerateModerateRequestContentVideo), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestContentVideo; } /// @@ -51,11 +51,11 @@ 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.NewModerateModerateRequestContentContentLeafAudio? FromJson( + public static global::ModerationAPI.NewModerateModerateRequestContentVideo? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.NewModerateModerateRequestContentContentLeafAudio), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestContentContentLeafAudio; + typeof(global::ModerationAPI.NewModerateModerateRequestContentVideo), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestContentVideo; } /// @@ -80,11 +80,11 @@ 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) { - 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.NewModerateModerateRequestContentContentLeafVideo.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentVideo.g.cs similarity index 86% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafVideo.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentVideo.g.cs index cd7e84e..28850af 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentContentLeafVideo.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestContentVideo.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Video /// - public sealed partial class NewModerateModerateRequestContentContentLeafVideo + public sealed partial class NewModerateModerateRequestContentVideo { /// /// @@ -29,7 +29,7 @@ public sealed partial class NewModerateModerateRequestContentContentLeafVideo 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. /// /// /// A public URL of the video content @@ -38,7 +38,7 @@ public sealed partial class NewModerateModerateRequestContentContentLeafVideo #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public NewModerateModerateRequestContentContentLeafVideo( + public NewModerateModerateRequestContentVideo( string url, string type = "video") { @@ -47,9 +47,9 @@ public NewModerateModerateRequestContentContentLeafVideo( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public NewModerateModerateRequestContentContentLeafVideo() + public NewModerateModerateRequestContentVideo() { } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieAdult.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieAdult.Json.g.cs new file mode 100644 index 0000000..25785a0 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieAdult.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateRequestPolicieAdult + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPolicieAdult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieAdult), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPolicieAdult; + } + + /// + /// 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.NewModerateModerateRequestPolicieAdult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.NewModerateModerateRequestPolicieAdult), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPolicieAdult; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieAdult.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieAdult.g.cs new file mode 100644 index 0000000..9c6d97b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieAdult.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateRequestPolicieAdult + { + /// + /// + /// + [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; } + + /// + /// + /// + /// "adult" + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = "adult"; + + /// + /// 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 NewModerateModerateRequestPolicieAdult( + bool flag, + double? threshold, + string id = "adult") + { + this.Flag = flag; + this.Threshold = threshold; + this.Id = id; + } + + /// + /// Initializes a new instance of the class. + /// + public NewModerateModerateRequestPolicieAdult() + { + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCannabis.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCannabis.Json.g.cs new file mode 100644 index 0000000..9049c04 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCannabis.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateRequestPolicieCannabis + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPolicieCannabis? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieCannabis), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPolicieCannabis; + } + + /// + /// 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.NewModerateModerateRequestPolicieCannabis? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.NewModerateModerateRequestPolicieCannabis), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPolicieCannabis; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCannabis.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCannabis.g.cs new file mode 100644 index 0000000..cc90041 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCannabis.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateRequestPolicieCannabis + { + /// + /// + /// + [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; } + + /// + /// + /// + /// "cannabis" + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = "cannabis"; + + /// + /// 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 NewModerateModerateRequestPolicieCannabis( + bool flag, + double? threshold, + string id = "cannabis") + { + this.Flag = flag; + this.Threshold = threshold; + this.Id = id; + } + + /// + /// Initializes a new instance of the class. + /// + public NewModerateModerateRequestPolicieCannabis() + { + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCodeAbuse.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCodeAbuse.g.cs index 06852f1..b4e8f8c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCodeAbuse.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCodeAbuse.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieCodeAbuse [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieCodeAbuse /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieCodeAbuse( bool flag, + double? threshold, string id = "code_abuse") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCrypto.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCrypto.Json.g.cs new file mode 100644 index 0000000..4b03e5b --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCrypto.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateRequestPolicieCrypto + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPolicieCrypto? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieCrypto), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPolicieCrypto; + } + + /// + /// 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.NewModerateModerateRequestPolicieCrypto? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.NewModerateModerateRequestPolicieCrypto), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPolicieCrypto; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCrypto.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCrypto.g.cs new file mode 100644 index 0000000..9695403 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieCrypto.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateRequestPolicieCrypto + { + /// + /// + /// + [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; } + + /// + /// + /// + /// "crypto" + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + public string Id { get; set; } = "crypto"; + + /// + /// 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 NewModerateModerateRequestPolicieCrypto( + bool flag, + double? threshold, + string id = "crypto") + { + this.Flag = flag; + this.Threshold = threshold; + this.Id = id; + } + + /// + /// Initializes a new instance of the class. + /// + public NewModerateModerateRequestPolicieCrypto() + { + } + } +} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieFlirtation.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieFlirtation.g.cs index f8afdd8..0f0ed56 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieFlirtation.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieFlirtation.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieFlirtation [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieFlirtation /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieFlirtation( bool flag, + double? threshold, string id = "flirtation") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieGuideline.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieGuideline.g.cs index f86caa8..48b66e6 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieGuideline.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieGuideline.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieGuideline [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -48,6 +54,7 @@ public sealed partial class NewModerateModerateRequestPolicieGuideline /// /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -56,9 +63,11 @@ public NewModerateModerateRequestPolicieGuideline( bool flag, string instructions, string guidelineKey, + double? threshold, string id = "guideline") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; this.Instructions = instructions ?? throw new global::System.ArgumentNullException(nameof(instructions)); this.GuidelineKey = guidelineKey ?? throw new global::System.ArgumentNullException(nameof(guidelineKey)); diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieHate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieHate.g.cs index c41df62..6e94ab9 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieHate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieHate.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieHate [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieHate /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieHate( bool flag, + double? threshold, string id = "hate") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicit.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicit.g.cs index 7188ca5..d22076a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicit.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicit.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieIllicit [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieIllicit /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieIllicit( bool flag, + double? threshold, string id = "illicit") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitAlcohol.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitAlcohol.g.cs index 42c6a5b..dbea470 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitAlcohol.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitAlcohol.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitAlcohol [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitAlcohol /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieIllicitAlcohol( bool flag, + double? threshold, string id = "illicit_alcohol") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitDrugs.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitDrugs.g.cs index 09cf927..3446fa6 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitDrugs.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitDrugs.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitDrugs [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitDrugs /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieIllicitDrugs( bool flag, + double? threshold, string id = "illicit_drugs") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitFirearms.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitFirearms.g.cs index 8101334..c248c24 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitFirearms.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitFirearms.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitFirearms [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitFirearms /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieIllicitFirearms( bool flag, + double? threshold, string id = "illicit_firearms") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitGambling.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitGambling.g.cs index 827c597..698958d 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitGambling.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitGambling.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitGambling [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitGambling /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieIllicitGambling( bool flag, + double? threshold, string id = "illicit_gambling") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitTobacco.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitTobacco.g.cs index 57433af..ce4c93a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitTobacco.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieIllicitTobacco.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitTobacco [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieIllicitTobacco /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieIllicitTobacco( bool flag, + double? threshold, string id = "illicit_tobacco") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePersonalInformation.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePersonalInformation.g.cs index 2090612..572d849 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePersonalInformation.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePersonalInformation.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPoliciePersonalInformation [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPoliciePersonalInformation /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPoliciePersonalInformation( bool flag, + double? threshold, string id = "personal_information") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities2.g.cs index 61e0d73..b091fc2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities2.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities2.g.cs @@ -8,34 +8,23 @@ namespace ModerationAPI /// public sealed partial class NewModerateModerateRequestPoliciePiiMaskingEntities2 { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestPoliciePiiMaskingEntitiesIdJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId Id { get; set; } - /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("enable")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Enable { get; set; } + public bool? Enable { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("flag")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Flag { get; set; } + public bool? Flag { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("shouldMask")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool ShouldMask { get; set; } + public bool? ShouldMask { get; set; } /// /// @@ -52,7 +41,6 @@ public sealed partial class NewModerateModerateRequestPoliciePiiMaskingEntities2 /// /// Initializes a new instance of the class. /// - /// /// /// /// @@ -61,13 +49,11 @@ public sealed partial class NewModerateModerateRequestPoliciePiiMaskingEntities2 [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPoliciePiiMaskingEntities2( - global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntitiesId id, - bool enable, - bool flag, - bool shouldMask, + bool? enable, + bool? flag, + bool? shouldMask, string? mask) { - this.Id = id; this.Enable = enable; this.Flag = flag; this.ShouldMask = shouldMask; diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities3.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities3.Json.g.cs new file mode 100644 index 0000000..784b50f --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities3.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateRequestPoliciePiiMaskingEntities3 + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities3), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities3; + } + + /// + /// 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.NewModerateModerateRequestPoliciePiiMaskingEntities3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.NewModerateModerateRequestPoliciePiiMaskingEntities3), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPoliciePiiMaskingEntities3; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities3.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities3.g.cs new file mode 100644 index 0000000..0cdb781 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntities3.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateRequestPoliciePiiMaskingEntities3 + { + + /// + /// 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.NewModerateModerateRequestPoliciePiiMaskingEntitiesId.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntitiesId.g.cs deleted file mode 100644 index cf2cf67..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePiiMaskingEntitiesId.g.cs +++ /dev/null @@ -1,93 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public enum NewModerateModerateRequestPoliciePiiMaskingEntitiesId - { - /// - /// - /// - Address, - /// - /// - /// - CreditCard, - /// - /// - /// - Email, - /// - /// - /// - IpAddress, - /// - /// - /// - Name, - /// - /// - /// - Phone, - /// - /// - /// - SensitiveOther, - /// - /// - /// - Url, - /// - /// - /// - Username, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class NewModerateModerateRequestPoliciePiiMaskingEntitiesIdExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this NewModerateModerateRequestPoliciePiiMaskingEntitiesId value) - { - return value switch - { - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Address => "address", - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.CreditCard => "credit_card", - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Email => "email", - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.IpAddress => "ip_address", - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Name => "name", - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Phone => "phone", - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.SensitiveOther => "sensitive_other", - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Url => "url", - NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Username => "username", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static NewModerateModerateRequestPoliciePiiMaskingEntitiesId? ToEnum(string value) - { - return value switch - { - "address" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Address, - "credit_card" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.CreditCard, - "email" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Email, - "ip_address" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.IpAddress, - "name" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Name, - "phone" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Phone, - "sensitive_other" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.SensitiveOther, - "url" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Url, - "username" => NewModerateModerateRequestPoliciePiiMaskingEntitiesId.Username, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePolitical.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePolitical.g.cs index f334eb2..c540883 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePolitical.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPoliciePolitical.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPoliciePolitical [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPoliciePolitical /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPoliciePolitical( bool flag, + double? threshold, string id = "political") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieProfanity.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieProfanity.g.cs index 0f9a93e..9f4f55e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieProfanity.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieProfanity.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieProfanity [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieProfanity /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieProfanity( bool flag, + double? threshold, string id = "profanity") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieReligion.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieReligion.g.cs index f77eb2f..4ce4fef 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieReligion.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieReligion.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieReligion [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieReligion /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieReligion( bool flag, + double? threshold, string id = "religion") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSelfHarm.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSelfHarm.g.cs index c7f6fbc..d327efd 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSelfHarm.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSelfHarm.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieSelfHarm [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieSelfHarm /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieSelfHarm( bool flag, + double? threshold, string id = "self_harm") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSelfPromotion.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSelfPromotion.g.cs index fcbccf4..ac8ff0a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSelfPromotion.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSelfPromotion.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieSelfPromotion [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieSelfPromotion /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieSelfPromotion( bool flag, + double? threshold, string id = "self_promotion") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexual.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexual.g.cs index 0dee70e..f79746e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexual.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSexual.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieSexual [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieSexual /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieSexual( bool flag, + double? threshold, string id = "sexual") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSpam.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSpam.g.cs index 6a29987..059f7d8 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSpam.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieSpam.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieSpam [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieSpam /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieSpam( bool flag, + double? threshold, string id = "spam") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieToxicity.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieToxicity.g.cs index 3a54b5e..bbdaf09 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieToxicity.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieToxicity.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieToxicity [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieToxicity /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieToxicity( bool flag, + double? threshold, string id = "toxicity") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieToxicitySevere.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieToxicitySevere.g.cs index 7dbcc31..f0ed254 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieToxicitySevere.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieToxicitySevere.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieToxicitySevere [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieToxicitySevere /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieToxicitySevere( bool flag, + double? threshold, string id = "toxicity_severe") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities2.g.cs index e7aed6c..de1ac08 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities2.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities2.g.cs @@ -8,34 +8,23 @@ namespace ModerationAPI /// public sealed partial class NewModerateModerateRequestPolicieUrlMaskingEntities2 { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::ModerationAPI.JsonConverters.NewModerateModerateRequestPolicieUrlMaskingEntitiesIdJsonConverter))] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId Id { get; set; } - /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("enable")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Enable { get; set; } + public bool? Enable { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("flag")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool Flag { get; set; } + public bool? Flag { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("shouldMask")] - [global::System.Text.Json.Serialization.JsonRequired] - public required bool ShouldMask { get; set; } + public bool? ShouldMask { get; set; } /// /// @@ -52,7 +41,6 @@ public sealed partial class NewModerateModerateRequestPolicieUrlMaskingEntities2 /// /// Initializes a new instance of the class. /// - /// /// /// /// @@ -61,13 +49,11 @@ public sealed partial class NewModerateModerateRequestPolicieUrlMaskingEntities2 [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieUrlMaskingEntities2( - global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntitiesId id, - bool enable, - bool flag, - bool shouldMask, + bool? enable, + bool? flag, + bool? shouldMask, string? mask) { - this.Id = id; this.Enable = enable; this.Flag = flag; this.ShouldMask = shouldMask; diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities3.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities3.Json.g.cs new file mode 100644 index 0000000..9ea0ec6 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities3.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateRequestPolicieUrlMaskingEntities3 + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities3? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities3), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities3; + } + + /// + /// 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.NewModerateModerateRequestPolicieUrlMaskingEntities3? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.NewModerateModerateRequestPolicieUrlMaskingEntities3), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateRequestPolicieUrlMaskingEntities3; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities3.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities3.g.cs new file mode 100644 index 0000000..0634e86 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntities3.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateRequestPolicieUrlMaskingEntities3 + { + + /// + /// 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.NewModerateModerateRequestPolicieUrlMaskingEntitiesId.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntitiesId.g.cs deleted file mode 100644 index 67c2a45..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieUrlMaskingEntitiesId.g.cs +++ /dev/null @@ -1,93 +0,0 @@ - -#nullable enable - -namespace ModerationAPI -{ - /// - /// - /// - public enum NewModerateModerateRequestPolicieUrlMaskingEntitiesId - { - /// - /// - /// - Address, - /// - /// - /// - CreditCard, - /// - /// - /// - Email, - /// - /// - /// - IpAddress, - /// - /// - /// - Name, - /// - /// - /// - Phone, - /// - /// - /// - SensitiveOther, - /// - /// - /// - Url, - /// - /// - /// - Username, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class NewModerateModerateRequestPolicieUrlMaskingEntitiesIdExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this NewModerateModerateRequestPolicieUrlMaskingEntitiesId value) - { - return value switch - { - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Address => "address", - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.CreditCard => "credit_card", - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Email => "email", - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.IpAddress => "ip_address", - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Name => "name", - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Phone => "phone", - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.SensitiveOther => "sensitive_other", - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Url => "url", - NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Username => "username", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static NewModerateModerateRequestPolicieUrlMaskingEntitiesId? ToEnum(string value) - { - return value switch - { - "address" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Address, - "credit_card" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.CreditCard, - "email" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Email, - "ip_address" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.IpAddress, - "name" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Name, - "phone" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Phone, - "sensitive_other" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.SensitiveOther, - "url" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Url, - "username" => NewModerateModerateRequestPolicieUrlMaskingEntitiesId.Username, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieViolence.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieViolence.g.cs index 04937b6..972fe2a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieViolence.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateRequestPolicieViolence.g.cs @@ -15,6 +15,12 @@ public sealed partial class NewModerateModerateRequestPolicieViolence [global::System.Text.Json.Serialization.JsonRequired] public required bool Flag { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("threshold")] + public double? Threshold { get; set; } + /// /// /// @@ -32,15 +38,18 @@ public sealed partial class NewModerateModerateRequestPolicieViolence /// Initializes a new instance of the class. /// /// + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public NewModerateModerateRequestPolicieViolence( bool flag, + double? threshold, string id = "violence") { this.Flag = flag; + this.Threshold = threshold; this.Id = id; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContent.g.cs index 63cf8e5..6dd8f5a 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContent.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContent.g.cs @@ -26,7 +26,7 @@ public sealed partial class NewModerateModerateResponseContent /// The modified content, if any. /// [global::System.Text.Json.Serialization.JsonPropertyName("modified")] - public global::ModerationAPI.AnyOf>>? Modified { get; set; } + public global::ModerationAPI.AnyOf>>? Modified { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -52,7 +52,7 @@ public sealed partial class NewModerateModerateResponseContent public NewModerateModerateResponseContent( string id, bool masked, - global::ModerationAPI.AnyOf>>? modified) + global::ModerationAPI.AnyOf>>? modified) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); this.Masked = masked; diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Image.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent.Json.g.cs similarity index 89% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Image.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent.Json.g.cs index 28b76a7..4e59927 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Image.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class NewModerateModerateResponseContentModifiedVariant1Image + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Image? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Image), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Image; + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent; } /// @@ -51,11 +51,11 @@ 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.NewModerateModerateResponseContentModifiedVariant1Image? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.NewModerateModerateResponseContentModifiedVariant1Image), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Image; + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent; } /// @@ -80,11 +80,11 @@ 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) { - 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.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent.g.cs new file mode 100644 index 0000000..d98d73c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContent + { + + /// + /// 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.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio.Json.g.cs new file mode 100644 index 0000000..570f995 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio; + } + + /// + /// 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.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Audio.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio.g.cs similarity index 86% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Audio.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio.g.cs index a4a66ac..3071bb4 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Audio.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Audio /// - public sealed partial class NewModerateModerateResponseContentModifiedVariant1Audio + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio { /// /// @@ -29,7 +29,7 @@ public sealed partial class NewModerateModerateResponseContentModifiedVariant1Au 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 URL of the audio content @@ -38,7 +38,7 @@ public sealed partial class NewModerateModerateResponseContentModifiedVariant1Au #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public NewModerateModerateResponseContentModifiedVariant1Audio( + public NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio( string url, string type = "audio") { @@ -47,9 +47,9 @@ public NewModerateModerateResponseContentModifiedVariant1Audio( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public NewModerateModerateResponseContentModifiedVariant1Audio() + public NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentAudio() { } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage.Json.g.cs new file mode 100644 index 0000000..eba66c3 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage; + } + + /// + /// 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.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Image.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage.g.cs similarity index 68% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Image.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage.g.cs index 09d224b..ddc75f2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Image.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Image /// - public sealed partial class NewModerateModerateResponseContentModifiedVariant1Image + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage { /// /// @@ -19,8 +19,13 @@ public sealed partial class NewModerateModerateResponseContentModifiedVariant1Im /// A public URL of the image content /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Url { get; set; } + public string? Url { get; set; } + + /// + /// Base64-encoded image data + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -29,27 +34,32 @@ public sealed partial class NewModerateModerateResponseContentModifiedVariant1Im 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. /// /// /// A public URL of the image content /// + /// + /// Base64-encoded image data + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public NewModerateModerateResponseContentModifiedVariant1Image( - string url, + public NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage( + string? url, + string? data, string type = "image") { this.Type = type; - this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + this.Url = url; + this.Data = data; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public NewModerateModerateResponseContentModifiedVariant1Image() + public NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentImage() { } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Text.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText.Json.g.cs similarity index 88% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Text.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText.Json.g.cs index 9577126..cbfe0c2 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Text.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class NewModerateModerateResponseContentModifiedVariant1Text + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Text? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Text), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Text; + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText; } /// @@ -51,11 +51,11 @@ 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.NewModerateModerateResponseContentModifiedVariant1Text? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.NewModerateModerateResponseContentModifiedVariant1Text), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Text; + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText; } /// @@ -80,11 +80,11 @@ 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) { - 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.NewModerateModerateResponseContentModifiedVariant1Text.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText.g.cs similarity index 86% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Text.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText.g.cs index 68ce99f..9acff2e 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Text.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Text /// - public sealed partial class NewModerateModerateResponseContentModifiedVariant1Text + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText { /// /// @@ -29,7 +29,7 @@ public sealed partial class NewModerateModerateResponseContentModifiedVariant1Te 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 content text @@ -38,7 +38,7 @@ public sealed partial class NewModerateModerateResponseContentModifiedVariant1Te #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public NewModerateModerateResponseContentModifiedVariant1Text( + public NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText( string text, string type = "text") { @@ -47,9 +47,9 @@ public NewModerateModerateResponseContentModifiedVariant1Text( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public NewModerateModerateResponseContentModifiedVariant1Text() + public NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentText() { } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo.Json.g.cs new file mode 100644 index 0000000..c3d416c --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo; + } + + /// + /// 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.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Video.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo.g.cs similarity index 86% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Video.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo.g.cs index 5961691..2143772 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Video.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// Video /// - public sealed partial class NewModerateModerateResponseContentModifiedVariant1Video + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo { /// /// @@ -29,7 +29,7 @@ public sealed partial class NewModerateModerateResponseContentModifiedVariant1Vi 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. /// /// /// A public URL of the video content @@ -38,7 +38,7 @@ public sealed partial class NewModerateModerateResponseContentModifiedVariant1Vi #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif - public NewModerateModerateResponseContentModifiedVariant1Video( + public NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo( string url, string type = "video") { @@ -47,9 +47,9 @@ public NewModerateModerateResponseContentModifiedVariant1Video( } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public NewModerateModerateResponseContentModifiedVariant1Video() + public NewModerateModerateResponseContentModifiedVariant1ModifiedNestedObjectContentVideo() { } } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent.Json.g.cs similarity index 90% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent.Json.g.cs index fbc90b6..bb9fe15 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class NewModerateModerateResponseContentModifiedVariant1 + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1; + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent; } /// @@ -51,11 +51,11 @@ 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.NewModerateModerateResponseContentModifiedVariant1? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.NewModerateModerateResponseContentModifiedVariant1), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1; + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent; } /// @@ -80,11 +80,11 @@ 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) { - 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.NewModerateModerateResponseContentModifiedVariant1.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent.g.cs similarity index 93% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent.g.cs index 00b7c6d..93adf3c 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public sealed partial class NewModerateModerateResponseContentModifiedVariant1 + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent { /// diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Audio.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2.Json.g.cs similarity index 89% rename from src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Audio.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2.Json.g.cs index 2b89a4a..6c3b249 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Audio.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2.Json.g.cs @@ -2,7 +2,7 @@ namespace ModerationAPI { - public sealed partial class NewModerateModerateResponseContentModifiedVariant1Audio + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2 { /// /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. @@ -34,14 +34,14 @@ public string ToJson( /// /// Deserializes a JSON string using the provided JsonSerializerContext. /// - public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Audio? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2? FromJson( string json, global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) { return global::System.Text.Json.JsonSerializer.Deserialize( json, - typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Audio), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Audio; + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2), + jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2; } /// @@ -51,11 +51,11 @@ 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.NewModerateModerateResponseContentModifiedVariant1Audio? FromJson( + public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2? FromJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { - return global::System.Text.Json.JsonSerializer.Deserialize( + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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.NewModerateModerateResponseContentModifiedVariant1Audio), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Audio; + typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2; } /// @@ -80,11 +80,11 @@ 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) { - 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.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2.g.cs new file mode 100644 index 0000000..9f6c630 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public sealed partial class NewModerateModerateResponseContentModifiedVariant1ModifiedObjectContent2 + { + + /// + /// 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.NewModerateModerateResponseContentModifiedVariant1Video.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Video.Json.g.cs deleted file mode 100644 index d7fae42..0000000 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseContentModifiedVariant1Video.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace ModerationAPI -{ - public sealed partial class NewModerateModerateResponseContentModifiedVariant1Video - { - /// - /// 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 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) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Video? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Video), - jsonSerializerContext) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Video; - } - - /// - /// 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.NewModerateModerateResponseContentModifiedVariant1Video? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - 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.NewModerateModerateResponseContentModifiedVariant1Video), - jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.NewModerateModerateResponseContentModifiedVariant1Video; - } - - /// - /// 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) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendationReasonCode.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendationReasonCode.g.cs index dae9dc8..e2c3354 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendationReasonCode.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.Models.NewModerateModerateResponseRecommendationReasonCode.g.cs @@ -24,6 +24,14 @@ public enum NewModerateModerateResponseRecommendationReasonCode /// /// SeverityReview, + /// + /// + /// + TrustedAllow, + /// + /// + /// + UntrustedSeverity, } /// @@ -42,6 +50,8 @@ public static string ToValueString(this NewModerateModerateResponseRecommendatio NewModerateModerateResponseRecommendationReasonCode.DryRun => "dry_run", NewModerateModerateResponseRecommendationReasonCode.SeverityReject => "severity_reject", NewModerateModerateResponseRecommendationReasonCode.SeverityReview => "severity_review", + NewModerateModerateResponseRecommendationReasonCode.TrustedAllow => "trusted_allow", + NewModerateModerateResponseRecommendationReasonCode.UntrustedSeverity => "untrusted_severity", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -56,6 +66,8 @@ public static string ToValueString(this NewModerateModerateResponseRecommendatio "dry_run" => NewModerateModerateResponseRecommendationReasonCode.DryRun, "severity_reject" => NewModerateModerateResponseRecommendationReasonCode.SeverityReject, "severity_review" => NewModerateModerateResponseRecommendationReasonCode.SeverityReview, + "trusted_allow" => NewModerateModerateResponseRecommendationReasonCode.TrustedAllow, + "untrusted_severity" => NewModerateModerateResponseRecommendationReasonCode.UntrustedSeverity, _ => null, }; } diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs index f70069e..d153ebe 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.ModerationAPIClient.NewModerateModerate.g.cs @@ -345,6 +345,9 @@ partial void ProcessNewModerateModerateResponseContent( /// /// The content sent for moderation /// + /// + /// Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. + /// /// /// Provide a channel ID or key. Will use the project's default channel if not provided. /// @@ -372,7 +375,8 @@ partial void ProcessNewModerateModerateResponseContent( /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task NewModerateModerateAsync( - global::ModerationAPI.OneOf?, global::ModerationAPI.NewModerateModerateRequestContentObject> content, + global::ModerationAPI.OneOf content, + double? timestamp = default, string? channel = default, string? contentId = default, global::ModerationAPI.NewModerateModerateRequestMetaType? metaType = default, @@ -380,12 +384,13 @@ partial void ProcessNewModerateModerateResponseContent( string? conversationId = default, object? metadata = default, bool? doNotStore = default, - global::System.Collections.Generic.IList>? policies = default, + global::System.Collections.Generic.IList>? policies = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::ModerationAPI.NewModerateModerateRequest { Content = content, + Timestamp = timestamp, Channel = channel, ContentId = contentId, MetaType = metaType, diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.23.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.26.Json.g.cs similarity index 92% rename from src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.23.Json.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.26.Json.g.cs index 89fc573..10646d1 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.23.Json.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.26.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. @@ -34,14 +34,14 @@ 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?; } /// @@ -51,11 +51,11 @@ 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) { - return global::System.Text.Json.JsonSerializer.Deserialize>( + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); } @@ -63,14 +63,14 @@ 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?; } /// @@ -80,11 +80,11 @@ 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) { - 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.23.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.26.g.cs similarity index 66% rename from src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.23.g.cs rename to src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.26.g.cs index 9e17460..3342cfa 100644 --- a/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.23.g.cs +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.26.g.cs @@ -6,7 +6,7 @@ namespace ModerationAPI /// /// /// - public readonly partial struct OneOf : global::System.IEquatable> + public readonly partial struct OneOf : global::System.IEquatable> { /// /// @@ -398,15 +398,66 @@ namespace ModerationAPI [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value23))] #endif public bool IsValue23 => Value23 != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public T24? Value24 { get; init; } +#else + public T24? Value24 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value24))] +#endif + public bool IsValue24 => Value24 != null; + /// /// /// - public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); +#if NET6_0_OR_GREATER + public T25? Value25 { get; init; } +#else + public T25? Value25 { get; } +#endif /// /// /// - public static implicit operator T1?(OneOf @this) => @this.Value1; +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value25))] +#endif + public bool IsValue25 => Value25 != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public T26? Value26 { get; init; } +#else + public T26? Value26 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value26))] +#endif + public bool IsValue26 => Value26 != null; + /// + /// + /// + public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(OneOf @this) => @this.Value1; /// /// @@ -419,12 +470,12 @@ public OneOf(T1? 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; /// /// @@ -437,12 +488,12 @@ public OneOf(T2? 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; /// /// @@ -455,12 +506,12 @@ public OneOf(T3? 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; /// /// @@ -473,12 +524,12 @@ public OneOf(T4? 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; /// /// @@ -491,12 +542,12 @@ public OneOf(T5? 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; /// /// @@ -509,12 +560,12 @@ public OneOf(T6? 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; /// /// @@ -527,12 +578,12 @@ public OneOf(T7? 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; /// /// @@ -545,12 +596,12 @@ public OneOf(T8? 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; /// /// @@ -563,12 +614,12 @@ public OneOf(T9? 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; /// /// @@ -581,12 +632,12 @@ public OneOf(T10? 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; /// /// @@ -599,12 +650,12 @@ public OneOf(T11? 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; /// /// @@ -617,12 +668,12 @@ public OneOf(T12? 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; /// /// @@ -635,12 +686,12 @@ public OneOf(T13? 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; /// /// @@ -653,12 +704,12 @@ public OneOf(T14? 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; /// /// @@ -671,12 +722,12 @@ public OneOf(T15? 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; /// /// @@ -689,12 +740,12 @@ public OneOf(T16? 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; /// /// @@ -707,12 +758,12 @@ public OneOf(T17? 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; /// /// @@ -725,12 +776,12 @@ public OneOf(T18? 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; /// /// @@ -743,12 +794,12 @@ public OneOf(T19? 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; /// /// @@ -761,12 +812,12 @@ public OneOf(T20? 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; /// /// @@ -779,12 +830,12 @@ public OneOf(T21? 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; /// /// @@ -797,12 +848,12 @@ public OneOf(T22? 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; /// /// @@ -812,6 +863,60 @@ public OneOf(T23? value) Value23 = value; } + /// + /// + /// + public static implicit operator OneOf(T24 value) => new OneOf((T24?)value); + + /// + /// + /// + public static implicit operator T24?(OneOf @this) => @this.Value24; + + /// + /// + /// + public OneOf(T24? value) + { + Value24 = value; + } + + /// + /// + /// + public static implicit operator OneOf(T25 value) => new OneOf((T25?)value); + + /// + /// + /// + public static implicit operator T25?(OneOf @this) => @this.Value25; + + /// + /// + /// + public OneOf(T25? value) + { + Value25 = value; + } + + /// + /// + /// + public static implicit operator OneOf(T26 value) => new OneOf((T26?)value); + + /// + /// + /// + public static implicit operator T26?(OneOf @this) => @this.Value26; + + /// + /// + /// + public OneOf(T26? value) + { + Value26 = value; + } + /// /// /// @@ -838,7 +943,10 @@ public OneOf( T20? value20, T21? value21, T22? value22, - T23? value23 + T23? value23, + T24? value24, + T25? value25, + T26? value26 ) { Value1 = value1; @@ -864,12 +972,18 @@ public OneOf( Value21 = value21; Value22 = value22; Value23 = value23; + Value24 = value24; + Value25 = value25; + Value26 = value26; } /// /// /// public object? Object => + Value26 as object ?? + Value25 as object ?? + Value24 as object ?? Value23 as object ?? Value22 as object ?? Value21 as object ?? @@ -921,7 +1035,10 @@ Value1 as object Value20?.ToString() ?? Value21?.ToString() ?? Value22?.ToString() ?? - Value23?.ToString() + Value23?.ToString() ?? + Value24?.ToString() ?? + Value25?.ToString() ?? + Value26?.ToString() ; /// @@ -929,7 +1046,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 || !IsValue1 && IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && IsValue20 && !IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && IsValue21 && !IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && IsValue22 && !IsValue23 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 && !IsValue6 && !IsValue7 && !IsValue8 && !IsValue9 && !IsValue10 && !IsValue11 && !IsValue12 && !IsValue13 && !IsValue14 && !IsValue15 && !IsValue16 && !IsValue17 && !IsValue18 && !IsValue19 && !IsValue20 && !IsValue21 && !IsValue22 && IsValue23; + 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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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 || !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; } /// @@ -959,6 +1076,9 @@ public bool Validate() global::System.Func? value21 = null, global::System.Func? value22 = null, global::System.Func? value23 = null, + global::System.Func? value24 = null, + global::System.Func? value25 = null, + global::System.Func? value26 = null, bool validate = true) { if (validate) @@ -1058,6 +1178,18 @@ public bool Validate() { return value23(Value23!); } + else if (IsValue24 && value24 != null) + { + return value24(Value24!); + } + else if (IsValue25 && value25 != null) + { + return value25(Value25!); + } + else if (IsValue26 && value26 != null) + { + return value26(Value26!); + } return default(TResult); } @@ -1089,6 +1221,9 @@ public void Match( global::System.Action? value21 = null, global::System.Action? value22 = null, global::System.Action? value23 = null, + global::System.Action? value24 = null, + global::System.Action? value25 = null, + global::System.Action? value26 = null, bool validate = true) { if (validate) @@ -1188,6 +1323,18 @@ public void Match( { value23?.Invoke(Value23!); } + else if (IsValue24) + { + value24?.Invoke(Value24!); + } + else if (IsValue25) + { + value25?.Invoke(Value25!); + } + else if (IsValue26) + { + value26?.Invoke(Value26!); + } } /// @@ -1243,6 +1390,12 @@ public override int GetHashCode() typeof(T22), Value23, typeof(T23), + Value24, + typeof(T24), + Value25, + typeof(T25), + Value26, + typeof(T26), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -1256,7 +1409,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) && @@ -1281,22 +1434,25 @@ public bool Equals(OneOf.Default.Equals(Value20, other.Value20) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Value21, other.Value21) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Value22, other.Value22) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value23, other.Value23) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value23, other.Value23) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value24, other.Value24) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value25, other.Value25) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value26, other.Value26) ; } /// /// /// - 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); } @@ -1306,7 +1462,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.OneOf.5.Json.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.5.Json.g.cs new file mode 100644 index 0000000..27c4c65 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.5.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace ModerationAPI +{ + public readonly partial struct OneOf + { + /// + /// 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 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) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + 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?; + } + + /// + /// 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.OneOf? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + 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.OneOf), + jsonSerializerContext).ConfigureAwait(false)) as global::ModerationAPI.OneOf?; + } + + /// + /// 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) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.5.g.cs b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.5.g.cs new file mode 100644 index 0000000..2de0bc7 --- /dev/null +++ b/src/libs/ModerationAPI/Generated/ModerationAPI.OneOf.5.g.cs @@ -0,0 +1,376 @@ + +#nullable enable + +namespace ModerationAPI +{ + /// + /// + /// + public readonly partial struct OneOf : 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; + + /// + /// + /// +#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; + + /// + /// + /// +#if NET6_0_OR_GREATER + public T3? Value3 { get; init; } +#else + public T3? Value3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] +#endif + public bool IsValue3 => Value3 != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public T4? Value4 { get; init; } +#else + public T4? Value4 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] +#endif + public bool IsValue4 => Value4 != null; + + /// + /// + /// +#if NET6_0_OR_GREATER + public T5? Value5 { get; init; } +#else + public T5? Value5 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] +#endif + public bool IsValue5 => Value5 != null; + /// + /// + /// + public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(OneOf @this) => @this.Value1; + + /// + /// + /// + public OneOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static implicit operator OneOf(T2 value) => new OneOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(OneOf @this) => @this.Value2; + + /// + /// + /// + public OneOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static implicit operator OneOf(T3 value) => new OneOf((T3?)value); + + /// + /// + /// + public static implicit operator T3?(OneOf @this) => @this.Value3; + + /// + /// + /// + public OneOf(T3? value) + { + Value3 = value; + } + + /// + /// + /// + public static implicit operator OneOf(T4 value) => new OneOf((T4?)value); + + /// + /// + /// + public static implicit operator T4?(OneOf @this) => @this.Value4; + + /// + /// + /// + public OneOf(T4? value) + { + Value4 = value; + } + + /// + /// + /// + public static implicit operator OneOf(T5 value) => new OneOf((T5?)value); + + /// + /// + /// + public static implicit operator T5?(OneOf @this) => @this.Value5; + + /// + /// + /// + public OneOf(T5? value) + { + Value5 = value; + } + + /// + /// + /// + public OneOf( + T1? value1, + T2? value2, + T3? value3, + T4? value4, + T5? value5 + ) + { + Value1 = value1; + Value2 = value2; + Value3 = value3; + Value4 = value4; + Value5 = value5; + } + + /// + /// + /// + public object? Object => + Value5 as object ?? + Value4 as object ?? + Value3 as object ?? + Value2 as object ?? + Value1 as object + ; + + /// + /// + /// + public override string? ToString() => + Value1?.ToString() ?? + Value2?.ToString() ?? + Value3?.ToString() ?? + Value4?.ToString() ?? + Value5?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 || !IsValue1 && IsValue2 && !IsValue3 && !IsValue4 && !IsValue5 || !IsValue1 && !IsValue2 && IsValue3 && !IsValue4 && !IsValue5 || !IsValue1 && !IsValue2 && !IsValue3 && IsValue4 && !IsValue5 || !IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 && IsValue5; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + global::System.Func? value3 = null, + global::System.Func? value4 = null, + global::System.Func? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + else if (IsValue3 && value3 != null) + { + return value3(Value3!); + } + else if (IsValue4 && value4 != null) + { + return value4(Value4!); + } + else if (IsValue5 && value5 != null) + { + return value5(Value5!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + global::System.Action? value3 = null, + global::System.Action? value4 = null, + global::System.Action? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + Value3, + typeof(T3), + Value4, + typeof(T4), + Value5, + typeof(T5), + }; + 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(OneOf other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) + ; + } + + /// + /// + /// + public static bool operator ==(OneOf obj1, OneOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(OneOf obj1, OneOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is OneOf o && Equals(o); + } + } +} diff --git a/src/libs/ModerationAPI/openapi.yaml b/src/libs/ModerationAPI/openapi.yaml index 79f9c46..a6a0cae 100644 --- a/src/libs/ModerationAPI/openapi.yaml +++ b/src/libs/ModerationAPI/openapi.yaml @@ -1,7273 +1,10103 @@ -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 -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: - description: Number of authors per page - default: 20 - type: number - - in: query - name: pageNumber - schema: - description: Page number to fetch - default: 1 - type: number - - in: query - name: sortBy - schema: - type: string - enum: - - trustLevel - - violationCount - - reportCount - - memberSince - - lastActive - - contentCount - - flaggedContentRatio - - averageSentiment - - in: query - name: sortDirection - schema: - description: Sort direction - default: desc - 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: - type: object - properties: - id: - description: Author ID in Moderation API - type: string - 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' - first_seen: - description: Timestamp when author first appeared - type: number - last_seen: - description: Timestamp of last activity - type: number - last_incident: - description: Timestamp of last incident - anyOf: - - type: number - - type: 'null' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - risk_evaluation: - description: Risk assessment details, if available. - 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' - metrics: - type: object - properties: - total_content: - description: Total pieces of content - type: number - flagged_content: - description: Number of flagged content pieces - type: number - 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: - description: >- - Additional metadata provided by your system. We recommend including any relevant - information that may assist in the moderation process. - 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: {} - required: - - id - - first_seen - - last_seen - - status - - trust_level - - block - - risk_evaluation - - metrics - - metadata - additionalProperties: false - 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) - 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' - metadata: - description: >- - Additional metadata provided by your system. We recommend including any relevant - information that may assist in the moderation process. - 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: {} - first_seen: - description: Timestamp when author first appeared - type: number - last_seen: - description: Timestamp of last activity - type: number - manual_trust_level: - anyOf: - - type: number - minimum: -1 - maximum: 4 - - type: 'null' - external_id: - description: External ID of the user, typically the ID of the author in your database. - type: string - required: - - external_id - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - id: - description: Author ID in Moderation API - type: string - 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' - first_seen: - description: Timestamp when author first appeared - type: number - last_seen: - description: Timestamp of last activity - type: number - last_incident: - description: Timestamp of last incident - anyOf: - - type: number - - type: 'null' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - risk_evaluation: - description: Risk assessment details, if available. - 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' - metrics: - type: object - properties: - total_content: - description: Total pieces of content - type: number - flagged_content: - description: Number of flagged content pieces - type: number - 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: - description: >- - Additional metadata provided by your system. We recommend including any relevant - information that may assist in the moderation process. - 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: {} - required: - - id - - first_seen - - last_seen - - status - - trust_level - - block - - risk_evaluation - - metrics - - metadata - 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 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) - /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: - description: Either external ID or the ID assigned by moderation API. - type: string - 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: - id: - description: Author ID in Moderation API - type: string - 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' - first_seen: - description: Timestamp when author first appeared - type: number - last_seen: - description: Timestamp of last activity - type: number - last_incident: - description: Timestamp of last incident - anyOf: - - type: number - - type: 'null' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - risk_evaluation: - description: Risk assessment details, if available. - 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' - metrics: - type: object - properties: - total_content: - description: Total pieces of content - type: number - flagged_content: - description: Number of flagged content pieces - type: number - 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: - description: >- - Additional metadata provided by your system. We recommend including any relevant - information that may assist in the moderation process. - 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: {} - required: - - id - - first_seen - - last_seen - - status - - trust_level - - block - - risk_evaluation - - metrics - - metadata - 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.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) - 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: - description: Either external ID or the ID assigned by moderation API. - type: string - 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' - metadata: - description: >- - Additional metadata provided by your system. We recommend including any relevant - information that may assist in the moderation process. - 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: {} - first_seen: - description: Timestamp when author first appeared - type: number - last_seen: - description: Timestamp of last activity - type: number - manual_trust_level: - anyOf: - - type: number - minimum: -1 - maximum: 4 - - type: 'null' - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - id: - description: Author ID in Moderation API - type: string - 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' - first_seen: - description: Timestamp when author first appeared - type: number - last_seen: - description: Timestamp of last activity - type: number - last_incident: - description: Timestamp of last incident - anyOf: - - type: number - - type: 'null' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - risk_evaluation: - description: Risk assessment details, if available. - 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' - metrics: - type: object - properties: - total_content: - description: Total pieces of content - type: number - flagged_content: - description: Number of flagged content pieces - type: number - 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: - description: >- - Additional metadata provided by your system. We recommend including any relevant - information that may assist in the moderation process. - 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: {} - required: - - id - - first_seen - - last_seen - - status - - trust_level - - block - - risk_evaluation - - metrics - - metadata - 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.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) - 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) - /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: - description: The queue ID - type: string - 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) - /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: - description: The queue ID - type: string - required: true - description: The queue ID - - in: query - name: withinDays - schema: - description: Number of days to analyze statistics for - default: '30' - type: string - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - reviewStats: - type: object - properties: - averageTimeToReview: - description: Average time in milliseconds to review an item - type: number - totalReviewed: - description: Total number of items reviewed - type: number - totalPending: - description: Total number of items pending review - type: number - required: - - averageTimeToReview - - totalReviewed - - totalPending - additionalProperties: false - actionStats: - type: array - items: - type: object - properties: - actionId: - description: ID of the moderation action - type: string - actionName: - description: Name of the moderation action - type: string - count: - description: Number of times this action was taken - type: number - percentageOfTotal: - description: Percentage this action represents of all actions - type: number - required: - - actionId - - actionName - - count - - percentageOfTotal - additionalProperties: false - topReviewers: - description: List of top reviewers and their statistics - type: array - items: - type: object - properties: - userId: - description: ID of the reviewer - type: string - name: - description: Name of the reviewer - type: string - reviewCount: - description: Number of items reviewed - type: number - averageTimePerReview: - description: Average review time in milliseconds - type: number - accuracyScore: - description: Optional accuracy score based on review quality metrics - type: number - topActions: - description: Most common actions taken by this reviewer - type: array - items: - type: object - properties: - actionId: - description: Most used action by this reviewer - type: string - actionName: - description: Name of the most used action - type: string - count: - description: Number of times this action was used - type: number - required: - - actionId - - actionName - - count - additionalProperties: false - required: - - userId - - name - - reviewCount - - averageTimePerReview - - topActions - additionalProperties: false - trends: - type: object - properties: - dailyReviewCounts: - type: array - items: - type: object - properties: - date: - description: Date in YYYY-MM-DD format - type: string - count: - description: Number of reviews on this date - type: number - required: - - date - - count - additionalProperties: false - flaggedContentTrends: - type: array - items: - type: object - properties: - label: - description: Content flag/label - type: string - trend: - description: >- - Trend indicator (-1 to 1) showing if this type of flagged content is - increasing or decreasing - type: number - 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) - /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: - description: The queue ID - type: string - required: true - description: The queue ID - - in: query - name: pageSize - schema: - description: Number of items per page - default: 20 - type: number - - in: query - name: pageNumber - schema: - description: Page number to fetch - default: 1 - type: number - - in: query - name: sortField - schema: - type: string - enum: - - createdAt - - severity - - reviewedAt - - in: query - name: sortDirection - schema: - description: Sort direction - default: desc - 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: - description: Content ID - type: string - content: - description: The content to be moderated - type: string - language: - description: Content language - type: string - labels: - type: array - items: - type: object - properties: - label: - description: Label name - type: string - score: - description: Confidence score of the label - type: number - flagged: - description: Whether this label caused a flag - type: boolean - 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: - description: Action ID - type: string - name: - description: Action name - type: string - comment: - description: Action comment - type: string - timestamp: - description: Unix timestamp of when the action was taken - type: number - reviewer: - description: Moderator userID - type: string - required: - - id - - name - - timestamp - additionalProperties: false - flagged: - description: Whether the item is flagged by any label - type: boolean - status: - description: Status of the item - type: string - enum: - - pending - - resolved - timestamp: - description: Unix timestamp of when the item was created - type: number - 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) - /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: - description: The queue ID - type: string - required: true - description: The queue ID - - in: path - name: itemId - schema: - description: The item ID to resolve - type: string - 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: - description: Timestamp when the item was resolved - type: string - 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) - /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: - description: The queue ID - type: string - required: true - description: The queue ID - - in: path - name: itemId - schema: - description: The item ID to unresolve - type: string - 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: - description: New status of the item - type: string - unresolvedAt: - description: Timestamp when the item was unresolved - type: string - 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) - /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: - description: List of moderation actions with their associated webhooks - type: array - items: - type: object - properties: - id: - description: The ID of the action. - type: string - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - createdAt: - description: The date the action was created. - type: string - name: - description: The name of the action. - type: string - 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: - description: Whether the action is a built-in action or a custom one. - default: false - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - description: >- - Whether the action resolves and removes the item, unresolves and re-add it to the - queue, or does not change the resolve status. - default: NO_CHANGE - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - description: The IDs of the queues the action is available in. - default: [] - type: array - items: - type: string - position: - description: Show the action in all queues, selected queues or no queues (to use via API only). - default: ALL_QUEUES - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - description: >- - The possible values of the action. The user will be prompted to select one of these - values when executing the action. - default: [] - type: array - items: - type: object - properties: - value: - description: The value of the action. - type: string - required: - - value - additionalProperties: false - valueRequired: - description: Whether the action requires a value to be executed. - default: false - type: boolean - freeText: - description: >- - Whether the action allows any text to be entered as a value or if it must be one of - the possible values. - default: false - type: boolean - webhooks: - description: The action's webhooks. - default: [] - type: array - items: - type: object - properties: - name: - description: The webhook's name, used to identify it in the dashboard - type: string - description: - description: The webhook's description - anyOf: - - type: string - - type: 'null' - url: - description: The webhook's URL. We'll call this URL when the event occurs. - type: string - format: uri - moderationActionId: - description: >- - The ID of the moderation action to trigger the webhook on. Only used for - moderation action webhooks. - anyOf: - - type: string - - type: 'null' - id: - description: The ID of the webhook. - type: string - required: - - name - - url - - id - additionalProperties: false - required: - - id - - createdAt - - name - - builtIn - - queueBehaviour - - filterInQueueIds - - position - - possibleValues - - valueRequired - - freeText - - webhooks - 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 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) - 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: - description: The name of the action. - type: string - 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: - description: Whether the action is a built-in action or a custom one. - default: false - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - description: >- - Whether the action resolves and removes the item, unresolves and re-add it to the queue, - or does not change the resolve status. - default: NO_CHANGE - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - description: The IDs of the queues the action is available in. - default: [] - type: array - items: - type: string - position: - description: Show the action in all queues, selected queues or no queues (to use via API only). - default: ALL_QUEUES - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - description: >- - The possible values of the action. The user will be prompted to select one of these values - when executing the action. - default: [] - type: array - items: - type: object - properties: - value: - description: The value of the action. - type: string - required: - - value - valueRequired: - description: Whether the action requires a value to be executed. - default: false - type: boolean - freeText: - description: >- - Whether the action allows any text to be entered as a value or if it must be one of the - possible values. - default: false - type: boolean - webhooks: - description: The action's webhooks. - default: [] - type: array - items: - type: object - properties: - name: - description: The webhook's name, used to identify it in the dashboard - type: string - description: - description: The webhook's description - anyOf: - - type: string - - type: 'null' - url: - description: The webhook's URL. We'll call this URL when the event occurs. - type: string - format: uri - id: - description: ID of an existing webhook or undefined if this is a new webhook. - type: string - required: - - name - - url - required: - - name - responses: - '200': - description: Action created successfully - content: - application/json: - schema: - type: object - properties: - id: - description: The ID of the action. - type: string - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - createdAt: - description: The date the action was created. - type: string - name: - description: The name of the action. - type: string - 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: - description: Whether the action is a built-in action or a custom one. - default: false - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - description: >- - Whether the action resolves and removes the item, unresolves and re-add it to the queue, - or does not change the resolve status. - default: NO_CHANGE - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - description: The IDs of the queues the action is available in. - default: [] - type: array - items: - type: string - position: - description: Show the action in all queues, selected queues or no queues (to use via API only). - default: ALL_QUEUES - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - description: >- - The possible values of the action. The user will be prompted to select one of these - values when executing the action. - default: [] - type: array - items: - type: object - properties: - value: - description: The value of the action. - type: string - required: - - value - additionalProperties: false - valueRequired: - description: Whether the action requires a value to be executed. - default: false - type: boolean - freeText: - description: >- - Whether the action allows any text to be entered as a value or if it must be one of the - possible values. - default: false - 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) - /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: - description: The ID of the action to get. - type: string - required: true - description: The ID of the action to get. - responses: - '200': - description: Action retrieved successfully - content: - application/json: - schema: - type: object - properties: - id: - description: The ID of the action. - type: string - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - createdAt: - description: The date the action was created. - type: string - name: - description: The name of the action. - type: string - 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: - description: Whether the action is a built-in action or a custom one. - default: false - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - description: >- - Whether the action resolves and removes the item, unresolves and re-add it to the queue, - or does not change the resolve status. - default: NO_CHANGE - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - description: The IDs of the queues the action is available in. - default: [] - type: array - items: - type: string - position: - description: Show the action in all queues, selected queues or no queues (to use via API only). - default: ALL_QUEUES - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - description: >- - The possible values of the action. The user will be prompted to select one of these - values when executing the action. - default: [] - type: array - items: - type: object - properties: - value: - description: The value of the action. - type: string - required: - - value - additionalProperties: false - valueRequired: - description: Whether the action requires a value to be executed. - default: false - type: boolean - freeText: - description: >- - Whether the action allows any text to be entered as a value or if it must be one of the - possible values. - default: false - type: boolean - webhooks: - description: The action's webhooks. - default: [] - type: array - items: - type: object - properties: - name: - description: The webhook's name, used to identify it in the dashboard - type: string - description: - description: The webhook's description - anyOf: - - type: string - - type: 'null' - url: - description: The webhook's URL. We'll call this URL when the event occurs. - type: string - format: uri - moderationActionId: - description: >- - The ID of the moderation action to trigger the webhook on. Only used for - moderation action webhooks. - anyOf: - - type: string - - type: 'null' - id: - description: The ID of the webhook. - type: string - required: - - name - - url - - id - additionalProperties: false - required: - - id - - createdAt - - name - - builtIn - - queueBehaviour - - filterInQueueIds - - position - - possibleValues - - valueRequired - - freeText - - webhooks - 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) - put: - operationId: actions-update - summary: Update an action - description: Update an action. - tags: - - Actions - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - description: The ID of the action to update. - type: string - 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: - description: The name of the action. - type: string - 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: - description: Whether the action is a built-in action or a custom one. - default: false - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - description: >- - Whether the action resolves and removes the item, unresolves and re-add it to the queue, - or does not change the resolve status. - default: NO_CHANGE - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - description: The IDs of the queues the action is available in. - default: [] - type: array - items: - type: string - position: - description: Show the action in all queues, selected queues or no queues (to use via API only). - default: ALL_QUEUES - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - description: >- - The possible values of the action. The user will be prompted to select one of these values - when executing the action. - default: [] - type: array - items: - type: object - properties: - value: - description: The value of the action. - type: string - required: - - value - valueRequired: - description: Whether the action requires a value to be executed. - default: false - type: boolean - freeText: - description: >- - Whether the action allows any text to be entered as a value or if it must be one of the - possible values. - default: false - type: boolean - webhooks: - description: The action's webhooks. - default: [] - type: array - items: - type: object - properties: - name: - description: The webhook's name, used to identify it in the dashboard - type: string - description: - description: The webhook's description - anyOf: - - type: string - - type: 'null' - url: - description: The webhook's URL. We'll call this URL when the event occurs. - type: string - format: uri - id: - description: ID of an existing webhook or undefined if this is a new webhook. - type: string - required: - - name - - url - responses: - '200': - description: Action updated successfully - content: - application/json: - schema: - type: object - properties: - id: - description: The ID of the action. - type: string - key: - description: User defined key of the action. - anyOf: - - type: string - - type: 'null' - createdAt: - description: The date the action was created. - type: string - name: - description: The name of the action. - type: string - 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: - description: Whether the action is a built-in action or a custom one. - default: false - anyOf: - - type: boolean - - type: 'null' - queueBehaviour: - description: >- - Whether the action resolves and removes the item, unresolves and re-add it to the queue, - or does not change the resolve status. - default: NO_CHANGE - type: string - enum: - - REMOVE - - ADD - - NO_CHANGE - filterInQueueIds: - description: The IDs of the queues the action is available in. - default: [] - type: array - items: - type: string - position: - description: Show the action in all queues, selected queues or no queues (to use via API only). - default: ALL_QUEUES - type: string - enum: - - ALL_QUEUES - - SOME_QUEUES - - HIDDEN - possibleValues: - description: >- - The possible values of the action. The user will be prompted to select one of these - values when executing the action. - default: [] - type: array - items: - type: object - properties: - value: - description: The value of the action. - type: string - required: - - value - additionalProperties: false - valueRequired: - description: Whether the action requires a value to be executed. - default: false - type: boolean - freeText: - description: >- - Whether the action allows any text to be entered as a value or if it must be one of the - possible values. - default: false - 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) - 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: - description: The ID of the action to delete. - type: string - required: true - description: The ID of the action to delete. - responses: - '200': - description: Action deleted successfully - content: - application/json: - schema: - type: object - properties: - deleted: - description: Whether the action was deleted. - type: boolean - id: - description: The ID of the action. - type: string - 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) - /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: - description: Input parameters - type: object - properties: - actionKey: - description: ID or key of the action to execute - type: string - 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 - responses: - '200': - description: Action executed successfully - content: - application/json: - schema: - description: Execution result - type: object - properties: - success: - description: Whether the action was executed successfully - 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' - '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) - /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: - description: The ID or key of the action to execute. - type: string - 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: - description: Action executed successfully. - type: boolean - actionId: - description: The ID of the action. - type: string - ids: - description: The IDs of the content items. - type: array - items: - type: string - 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) - /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: - description: Input parameters for text moderation - type: object - properties: - contentId: - description: The unique ID of the content in your database. - type: string - minLength: 1 - maxLength: 100 - value: - description: The text you'd like to analyze. We recommend to submit plain text or HTML - type: string - minLength: 1 - maxLength: 100000 - 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 - responses: - '200': - description: Successful response - content: - application/json: - schema: - description: Moderation analysis results including model outputs and detected patterns - allOf: - - type: object - properties: - status: - description: Success if the request was successful - type: string - 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: - description: Information about the request - type: object - properties: - timestamp: - description: The timestamp of the request - type: number - quota_usage: - description: The quota usage of the request - type: number - required: - - timestamp - - quota_usage - additionalProperties: false - flagged: - description: Whether the content was flagged by any models - type: boolean - author: - description: >- - The author of the content if your account has authors enabled. Requires you to send - authorId when submitting content. - anyOf: - - type: object - properties: - id: - description: Author ID in Moderation API - type: string - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - content_moderated: - description: Whether the content was moderated or not. Same as `content` !== `original` - type: boolean - unicode_spoofing: - description: Whether the content is using look-alike characters. Often used by spammers. - type: boolean - data_found: - description: Whether any entity matchers found data for the content - type: boolean - original: - description: The original content - type: string - content: - description: >- - The content after moderation. With all mask replacements applied and look-alike - characters replaced with the original characters. - type: string - 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: - description: The flagging mode. - type: string - enum: - - BLOCK_LIST - - REQUIRE_LIST - - PASS_LIST - 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: - description: Whether the wordlists flagged the content. - type: boolean - name: - description: The name of the wordlist - type: string - id: - description: The ID of the wordlist - type: string - score: - description: The score of the wordlist - type: number - 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: {} - '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: - description: The object you want to analyze. - type: object - properties: - type: - description: The type of the object you want to analyze. - type: string - enum: - - profile - - event - - product - - object - data: - type: object - propertyNames: - type: string - additionalProperties: - type: object - properties: - type: - description: The type of content (e.g., "text", "image", "video") - type: string - enum: - - text - - image - - video - - audio - modelIds: - description: Optional array of specific model IDs to use - type: array - items: - type: string - value: - description: The content to analyze - type: string - required: - - type - - value - required: - - type - - data - required: - - value - responses: - '200': - description: Successful response - content: - application/json: - schema: - allOf: - - type: object - properties: - status: - description: Success if the request was successful - type: string - 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: - description: Information about the request - type: object - properties: - timestamp: - description: The timestamp of the request - type: number - quota_usage: - description: The quota usage of the request - type: number - required: - - timestamp - - quota_usage - additionalProperties: false - flagged: - description: Whether the content was flagged by any models - type: boolean - author: - description: >- - The author of the content if your account has authors enabled. Requires you to send - authorId when submitting content. - anyOf: - - type: object - properties: - id: - description: Author ID in Moderation API - type: string - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - unicode_spoofing: - description: Whether the content is using look-alike characters. Often used by spammers. - type: boolean - data_found: - description: Whether any entity matchers found data for the content - type: boolean - labels: - description: The scores of each label - type: array - items: - type: object - properties: - label: - description: The label of the model - type: string - model: - description: The model that found the label - type: string - score: - description: The confidence of the model - type: number - minimum: 0 - maximum: 1 - required: - - label - - model - - score - additionalProperties: false - entities: - description: The entities found in the content - type: array - items: - type: object - properties: - model: - description: The model that found the entity - type: string - matches: - description: The matches of the entity - type: array - items: - type: string - score: - description: The similarity score of the matches - type: number - required: - - model - - matches - 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: - description: The flagging mode. - type: string - enum: - - BLOCK_LIST - - REQUIRE_LIST - - PASS_LIST - 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: - description: Whether the wordlists flagged the content. - type: boolean - name: - description: The name of the wordlist - type: string - id: - description: The ID of the wordlist - type: string - score: - description: The score of the wordlist - type: number - required: - - mode - - flagged - - name - - id - - score - additionalProperties: false - fields: - description: The fields in the object and their flags - type: array - items: - type: object - properties: - key: - description: The key of the field - type: string - flagged: - description: Whether the field was flagged - type: boolean - flagged_by: - description: The models that flagged the field - type: array - items: - type: string - required: - - key - - flagged - - flagged_by - additionalProperties: false - 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: - description: The URL of the image you want to analyze. - type: string - format: uri - required: - - url - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - status: - description: Success if the request was successful - type: string - 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: - description: Information about the request - type: object - properties: - timestamp: - description: The timestamp of the request - type: number - quota_usage: - description: The quota usage of the request - type: number - required: - - timestamp - - quota_usage - additionalProperties: false - flagged: - description: Whether the content was flagged by any models - type: boolean - author: - description: >- - The author of the content if your account has authors enabled. Requires you to send - authorId when submitting content. - anyOf: - - type: object - properties: - id: - description: Author ID in Moderation API - type: string - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - labels: - description: The scores of each label - type: array - items: - type: object - properties: - label: - description: The label of the model - type: string - enum: - - nudity - - suggestive - - gore - - hate - - violence - - weapon - - smoking - - drugs - - alcohol - - text - - toxic - score: - description: The confidence of the model - type: number - minimum: 0 - maximum: 1 - required: - - label - - score - additionalProperties: false - 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: - description: Input parameters for video moderation - 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: - description: The URL of the video you want to analyze. - type: string - format: uri - required: - - url - responses: - '200': - description: Successful response - content: - application/json: - schema: - allOf: - - type: object - properties: - status: - description: Success if the request was successful - type: string - 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: - description: Information about the request - type: object - properties: - timestamp: - description: The timestamp of the request - type: number - quota_usage: - description: The quota usage of the request - type: number - required: - - timestamp - - quota_usage - additionalProperties: false - flagged: - description: Whether the content was flagged by any models - type: boolean - author: - description: >- - The author of the content if your account has authors enabled. Requires you to send - authorId when submitting content. - anyOf: - - type: object - properties: - id: - description: Author ID in Moderation API - type: string - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - 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: - description: Input parameters for audio moderation - 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: - description: The URL of the audio you want to analyze. - type: string - format: uri - required: - - url - responses: - '200': - description: Successful response - content: - application/json: - schema: - description: Audio moderation analysis results - type: object - properties: - status: - description: Success if the request was successful - type: string - 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: - description: Information about the request - type: object - properties: - timestamp: - description: The timestamp of the request - type: number - quota_usage: - description: The quota usage of the request - type: number - required: - - timestamp - - quota_usage - additionalProperties: false - flagged: - description: Whether the content was flagged by any models - type: boolean - author: - description: >- - The author of the content if your account has authors enabled. Requires you to send - authorId when submitting content. - anyOf: - - type: object - properties: - id: - description: Author ID in Moderation API - type: string - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - required: - - status - - request - - flagged - - author - 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' - /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: - description: ID of the account - type: string - paid_plan_name: - description: Name of the paid plan - type: string - text_api_quota: - description: Text API quota - type: number - remaining_quota: - description: Remaining quota - type: number - current_project: - type: object - properties: - id: - description: ID of the current project - type: string - name: - description: Name of the current project - type: string - 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) - /auth: - get: - operationId: account-legacyAuthGet - security: - - Authorization: [] - deprecated: true - parameters: [] - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - status: - description: Status of the authentication - type: string - message: - description: Message of the authentication - type: string - 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) - 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: - description: Status of the authentication - type: string - message: - description: Message of the authentication - type: string - project: - description: Name of the authenticated project - type: string - 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) - /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: - description: Array of wordlists - type: array - items: - type: object - properties: - id: - description: Unique identifier of the wordlist - type: string - name: - description: Name of the wordlist - anyOf: - - type: string - - type: 'null' - description: - description: Description of the wordlist - anyOf: - - type: string - - type: 'null' - createdAt: - description: When the wordlist was created - anyOf: - - type: string - - type: 'null' - userId: - description: User who created the wordlist - anyOf: - - type: string - - type: 'null' - required: - - id - - name - - description - - createdAt - - userId - 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' - '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) - /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: - description: ID of the wordlist to get - type: string - required: true - description: ID of the wordlist to get - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - id: - description: ID of the wordlist - type: string - name: - anyOf: - - description: Name of the wordlist - type: string - - type: 'null' - words: - description: Words in the wordlist - type: array - items: - type: string - createdAt: - description: Creation date of the wordlist - type: string - organizationId: - description: ID of the organization - type: string - userId: - anyOf: - - description: ID of the user - type: string - - type: 'null' - strict: - description: Strict mode - type: boolean - 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) - put: - operationId: wordlist-update - summary: Update wordlist - description: Update a wordlist - tags: - - wordlist - security: - - Authorization: [] - parameters: - - in: path - name: id - schema: - description: ID of the wordlist to update - type: string - 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: - description: ID of the wordlist - type: string - name: - anyOf: - - description: Name of the wordlist - type: string - - type: 'null' - words: - description: Words in the wordlist - type: array - items: - type: string - createdAt: - description: Creation date of the wordlist - type: string - organizationId: - description: ID of the organization - type: string - userId: - anyOf: - - description: ID of the user - type: string - - type: 'null' - strict: - description: Strict mode - type: boolean - 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) - /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: - description: ID of the wordlist to check embedding status for - type: string - required: true - description: ID of the wordlist to check embedding status for - responses: - '200': - description: Successful response - content: - application/json: - schema: - description: Embedding status details - type: object - properties: - progress: - description: Percentage of words that have been embedded (0-100) - type: number - totalWords: - description: Total number of words in the wordlist - type: number - remainingWords: - description: Number of words still waiting to be embedded - type: number - required: - - progress - - totalWords - - remainingWords - 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.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) - /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: - description: ID of the wordlist to add words to - type: string - required: true - description: ID of the wordlist to add words to - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - words: - description: Array of words to add to the wordlist. Duplicate words will be ignored. - type: array - items: - type: string - required: - - words - responses: - '200': - description: Words successfully added to wordlist - content: - application/json: - schema: - type: object - properties: - addedCount: - description: Number of words added - type: number - totalCount: - description: Total number of words in wordlist - type: number - addedWords: - description: List of words that were added - type: array - items: - type: string - 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) - 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: - description: ID of the wordlist to remove words from - type: string - required: true - description: ID of the wordlist to remove words from - - in: query - name: words - schema: - description: Array of words to remove from the wordlist - type: array - items: - type: string - 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: - description: Number of words removed - type: number - totalCount: - description: Total number of words in wordlist - type: number - removedWords: - description: List of words removed - type: array - items: - type: string - 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) - /moderate: - post: - operationId: newModerate-moderate - security: - - Authorization: [] - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - content: - description: The content sent for moderation - oneOf: - - title: Content leaf - oneOf: - - description: Text - title: Text - type: object - properties: - type: - type: string - const: text - text: - description: The content text - type: string - minLength: 1 - maxLength: 100000 - required: - - type - - text - - description: Image - title: Image - type: object - properties: - type: - type: string - const: image - url: - description: A public URL of the image content - type: string - format: uri - required: - - type - - url - - description: Video - title: Video - type: object - properties: - type: - type: string - const: video - url: - description: A public URL of the video content - type: string - format: uri - required: - - type - - url - - description: Audio - title: Audio - type: object - properties: - type: - type: string - const: audio - url: - description: The URL of the audio content - type: string - format: uri - required: - - type - - url - type: object - - description: Object - title: Object - type: object - properties: - type: - type: string - const: object - data: - description: Values in the object. Can be mixed content types. - type: object - propertyNames: - description: The key of the content node - type: string - additionalProperties: - title: Content leaf - oneOf: - - description: Text - title: Text - type: object - properties: - type: - type: string - const: text - text: - description: The content text - type: string - minLength: 1 - maxLength: 100000 - required: - - type - - text - - description: Image - title: Image - type: object - properties: - type: - type: string - const: image - url: - description: A public URL of the image content - type: string - format: uri - required: - - type - - url - - description: Video - title: Video - type: object - properties: - type: - type: string - const: video - url: - description: A public URL of the video content - type: string - format: uri - required: - - type - - url - - description: Audio - title: Audio - type: object - properties: - type: - type: string - const: audio - url: - description: The URL of the audio content - type: string - format: uri - required: - - type - - url - type: object - required: - - type - - data - type: object - 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 - - 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: {} - 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: - - title: Toxicity - type: object - properties: - flag: - type: boolean - id: - type: string - const: toxicity - required: - - flag - - id - - title: Personal Information - type: object - properties: - flag: - type: boolean - id: - type: string - const: personal_information - required: - - flag - - id - - title: Toxicity Severe - type: object - properties: - flag: - type: boolean - id: - type: string - const: toxicity_severe - required: - - flag - - id - - title: Hate - type: object - properties: - flag: - type: boolean - id: - type: string - const: hate - required: - - flag - - id - - title: Illicit - type: object - properties: - flag: - type: boolean - id: - type: string - const: illicit - required: - - flag - - id - - title: Illicit Drugs - type: object - properties: - flag: - type: boolean - id: - type: string - const: illicit_drugs - required: - - flag - - id - - title: Illicit Alcohol - type: object - properties: - flag: - type: boolean - id: - type: string - const: illicit_alcohol - required: - - flag - - id - - title: Illicit Firearms - type: object - properties: - flag: - type: boolean - id: - type: string - const: illicit_firearms - required: - - flag - - id - - title: Illicit Tobacco - type: object - properties: - flag: - type: boolean - id: - type: string - const: illicit_tobacco - required: - - flag - - id - - title: Illicit Gambling - type: object - properties: - flag: - type: boolean - id: - type: string - const: illicit_gambling - required: - - flag - - id - - title: Sexual - type: object - properties: - flag: - type: boolean - id: - type: string - const: sexual - required: - - flag - - id - - title: Flirtation - type: object - properties: - flag: - type: boolean - id: - type: string - const: flirtation - required: - - flag - - id - - title: Profanity - type: object - properties: - flag: - type: boolean - id: - type: string - const: profanity - required: - - flag - - id - - title: Violence - type: object - properties: - flag: - type: boolean - id: - type: string - const: violence - required: - - flag - - id - - title: Self Harm - type: object - properties: - flag: - type: boolean - id: - type: string - const: self_harm - required: - - flag - - id - - title: Spam - type: object - properties: - flag: - type: boolean - id: - type: string - const: spam - required: - - flag - - id - - title: Self Promotion - type: object - properties: - flag: - type: boolean - id: - type: string - const: self_promotion - required: - - flag - - id - - title: Political - type: object - properties: - flag: - type: boolean - id: - type: string - const: political - required: - - flag - - id - - title: Religion - type: object - properties: - flag: - type: boolean - id: - type: string - const: religion - required: - - flag - - id - - title: Code Abuse - type: object - properties: - flag: - type: boolean - id: - type: string - const: code_abuse - required: - - flag - - id - - title: PII Masking - 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: - id: - type: string - enum: - - email - - phone - - url - - address - - name - - username - - ip_address - - credit_card - - sensitive_other - enable: - type: boolean - flag: - type: boolean - shouldMask: - type: boolean - mask: - type: string - required: - - id - - enable - - flag - - shouldMask - required: - - id - - entities - - title: URL 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: - id: - type: string - enum: - - email - - phone - - url - - address - - name - - username - - ip_address - - credit_card - - sensitive_other - enable: - type: boolean - flag: - type: boolean - shouldMask: - type: boolean - mask: - type: string - required: - - id - - enable - - flag - - shouldMask - required: - - id - - entities - - title: Guideline - type: object - properties: - flag: - type: boolean - id: - type: string - const: guideline - instructions: - type: string - guidelineKey: - type: string - required: - - flag - - id - - instructions - - guidelineKey - type: object - required: - - content - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - content: - description: Potentially modified content. - type: object - properties: - id: - description: >- - The unique identifier for the content. Either the contentId provided by you or an - autogenerated ID. - type: string - masked: - description: Whether any values have been masked. - type: boolean - modified: - description: The modified content, if any. - anyOf: - - anyOf: - - type: string - - type: object - propertyNames: - type: string - additionalProperties: - title: Content leaf - oneOf: - - description: Text - title: Text - type: object - properties: - type: - type: string - const: text - text: - description: The content text - type: string - minLength: 1 - maxLength: 100000 - required: - - type - - text - additionalProperties: false - - description: Image - title: Image - type: object - properties: - type: - type: string - const: image - url: - description: A public URL of the image content - type: string - format: uri - required: - - type - - url - additionalProperties: false - - description: Video - title: Video - type: object - properties: - type: - type: string - const: video - url: - description: A public URL of the video content - type: string - format: uri - required: - - type - - url - additionalProperties: false - - description: Audio - title: Audio - type: object - properties: - type: - type: string - const: audio - url: - description: The URL of the audio content - type: string - format: uri - required: - - type - - url - additionalProperties: false - type: object - - type: 'null' - required: - - id - - masked - - modified - additionalProperties: false - author: - description: >- - The author of the content if your account has authors enabled. Requires you to send - authorId when submitting content. - anyOf: - - type: object - properties: - id: - description: Author ID in Moderation API - type: string - external_id: - description: The author's ID from your system - anyOf: - - type: string - - type: 'null' - block: - description: Block or suspension details, if applicable. Null if the author is enabled. - 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' - status: - description: Current author status - type: string - enum: - - enabled - - suspended - - blocked - trust_level: - type: object - properties: - level: - description: Author trust level (-1, 0, 1, 2, 3, or 4) - type: number - manual: - description: True if the trust level was set manually by a moderator - type: boolean - required: - - level - - manual - additionalProperties: false - required: - - id - - block - - status - - trust_level - additionalProperties: false - - type: 'null' - evaluation: - description: The evaluation of the content after running the channel policies. - type: object - properties: - flagged: - description: Whether the content was flagged by any policy. - type: boolean - flag_probability: - description: The probability that the content should be flagged. - type: number - severity_score: - description: The severity score of the content. A higher score indicates more severe content. - type: number - unicode_spoofed: - description: Whether the content was flagged for Unicode spoofing. - type: boolean - required: - - flagged - - flag_probability - - severity_score - additionalProperties: false - recommendation: - description: The recommendation for the content based on the evaluation. - type: object - properties: - action: - description: The action to take based on the recommendation - type: string - enum: - - review - - allow - - reject - reason_codes: - description: The reason code for the recommendation. Can be used to display a reason to the user. - type: array - items: - type: string - enum: - - severity_reject - - severity_review - - author_block - - dry_run - required: - - action - - reason_codes - additionalProperties: false - policies: - description: Results of all policies in the channel. Sorted by highest probability. - type: array - items: - description: Policy output schema. - oneOf: - - description: Classifier policy. - title: Classifier output - type: object - properties: - id: - description: The unique identifier for the classifier output. - type: string - 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 - required: - - id - - type - - probability - - flagged - additionalProperties: false - - description: Entity matcher policy. - title: Entity matcher 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 - required: - - probability - - match - - span - additionalProperties: false - required: - - id - - type - - probability - - flagged - - matches - additionalProperties: false - type: object - insights: - description: Results of all insights enabled in the channel. - type: array - items: - oneOf: - - description: Sentiment insight - title: Sentiment insight - 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: Language insight - title: Language 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 - type: object - meta: - description: Metadata about the moderation request - type: object - properties: - status: - type: string - enum: - - success - - partial_success - timestamp: - type: number - channel_key: - description: >- - The unique key of the channel where the content was handled. Either the channel - provided by you or automatically routed. - type: string - usage: - type: number - processing_time: - type: string - required: - - status - - timestamp - - channel_key - - usage - additionalProperties: false - 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: 'x', 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": "x", - "type": "text", +{ + "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" + } + ], + "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": { + "description": "Number of authors per page", + "default": 20, + "type": "number" + } + }, + { + "in": "query", + "name": "pageNumber", + "schema": { + "description": "Page number to fetch", + "default": 1, + "type": "number" + } + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "trustLevel", + "violationCount", + "reportCount", + "memberSince", + "lastActive", + "contentCount", + "flaggedContentRatio", + "averageSentiment" + ] + } + }, + { + "in": "query", + "name": "sortDirection", + "schema": { + "description": "Sort direction", + "default": "desc", + "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": { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "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" + } + ] + }, + "first_seen": { + "description": "Timestamp when author first appeared", + "type": "number" + }, + "last_seen": { + "description": "Timestamp of last activity", + "type": "number" + }, + "last_incident": { + "description": "Timestamp of last incident", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "risk_evaluation": { + "description": "Risk assessment details, if available.", + "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" + } + ] + }, + "metrics": { + "type": "object", + "properties": { + "total_content": { + "description": "Total pieces of content", + "type": "number" + }, + "flagged_content": { + "description": "Number of flagged content pieces", + "type": "number" + }, + "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": { + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process.", + "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": {} + } + }, + "required": [ + "id", + "first_seen", + "last_seen", + "status", + "trust_level", + "block", + "risk_evaluation", + "metrics", + "metadata" + ], + "additionalProperties": false + } + }, + "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)" + } + ] + }, + "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" + } + ] + }, + "metadata": { + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process.", + "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": {} + }, + "first_seen": { + "description": "Timestamp when author first appeared", + "type": "number" + }, + "last_seen": { + "description": "Timestamp of last activity", + "type": "number" + }, + "manual_trust_level": { + "anyOf": [ + { + "type": "number", + "minimum": -1, + "maximum": 4 + }, + { + "type": "null" + } + ] + }, + "external_id": { + "description": "External ID of the user, typically the ID of the author in your database.", + "type": "string" + } }, - ) - 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: "x", type: :text}) - - puts(response) -components: - schemas: - error.BAD_REQUEST: - title: Invalid input data error (400) - description: The error information - example: - code: BAD_REQUEST - message: Invalid input data - issues: [] - type: object - properties: - message: - description: The error message - example: Invalid input data - type: string - code: - description: The error code - example: BAD_REQUEST - type: string - 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 - error.UNAUTHORIZED: - title: Authorization not provided error (401) - description: The error information - example: - code: UNAUTHORIZED - message: Authorization not provided - issues: [] - type: object - properties: - message: - description: The error message - example: Authorization not provided - type: string - code: - description: The error code - example: UNAUTHORIZED - type: string - 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 - error.FORBIDDEN: - title: Insufficient access error (403) - description: The error information - example: - code: FORBIDDEN - message: Insufficient access - issues: [] - type: object - properties: - message: - description: The error message - example: Insufficient access - type: string - code: - description: The error code - example: FORBIDDEN - type: string - 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 - error.NOT_FOUND: - title: Not found error (404) - description: The error information - example: - code: NOT_FOUND - message: Not found - issues: [] - type: object - properties: - message: - description: The error message - example: Not found - type: string - code: - description: The error code - example: NOT_FOUND - type: string - 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 - error.INTERNAL_SERVER_ERROR: - title: Internal server error error (500) - description: The error information - example: - code: INTERNAL_SERVER_ERROR - message: Internal server error - issues: [] - type: object - properties: - message: - description: The error message - example: Internal server error - type: string - code: - description: The error code - example: INTERNAL_SERVER_ERROR - type: string - 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 - error.CONFLICT: - title: Action with this key already exists error (409) - description: The error information - example: - code: CONFLICT - message: Action with this key already exists - issues: [] - type: object - properties: - message: - description: The error message - example: Action with this key already exists - type: string - code: - description: The error code - example: CONFLICT - type: string - 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 - securitySchemes: - Authorization: - type: http - scheme: bearer + "required": [ + "external_id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "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" + } + ] + }, + "first_seen": { + "description": "Timestamp when author first appeared", + "type": "number" + }, + "last_seen": { + "description": "Timestamp of last activity", + "type": "number" + }, + "last_incident": { + "description": "Timestamp of last incident", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "risk_evaluation": { + "description": "Risk assessment details, if available.", + "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" + } + ] + }, + "metrics": { + "type": "object", + "properties": { + "total_content": { + "description": "Total pieces of content", + "type": "number" + }, + "flagged_content": { + "description": "Number of flagged content pieces", + "type": "number" + }, + "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": { + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process.", + "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": {} + } + }, + "required": [ + "id", + "first_seen", + "last_seen", + "status", + "trust_level", + "block", + "risk_evaluation", + "metrics", + "metadata" + ], + "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 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)" + } + ] + } + }, + "/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": { + "description": "Either external ID or the ID assigned by moderation API.", + "type": "string" + }, + "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": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "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" + } + ] + }, + "first_seen": { + "description": "Timestamp when author first appeared", + "type": "number" + }, + "last_seen": { + "description": "Timestamp of last activity", + "type": "number" + }, + "last_incident": { + "description": "Timestamp of last incident", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "risk_evaluation": { + "description": "Risk assessment details, if available.", + "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" + } + ] + }, + "metrics": { + "type": "object", + "properties": { + "total_content": { + "description": "Total pieces of content", + "type": "number" + }, + "flagged_content": { + "description": "Number of flagged content pieces", + "type": "number" + }, + "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": { + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process.", + "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": {} + } + }, + "required": [ + "id", + "first_seen", + "last_seen", + "status", + "trust_level", + "block", + "risk_evaluation", + "metrics", + "metadata" + ], + "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.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)" + } + ] + }, + "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": { + "description": "Either external ID or the ID assigned by moderation API.", + "type": "string" + }, + "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" + } + ] + }, + "metadata": { + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process.", + "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": {} + }, + "first_seen": { + "description": "Timestamp when author first appeared", + "type": "number" + }, + "last_seen": { + "description": "Timestamp of last activity", + "type": "number" + }, + "manual_trust_level": { + "anyOf": [ + { + "type": "number", + "minimum": -1, + "maximum": 4 + }, + { + "type": "null" + } + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "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" + } + ] + }, + "first_seen": { + "description": "Timestamp when author first appeared", + "type": "number" + }, + "last_seen": { + "description": "Timestamp of last activity", + "type": "number" + }, + "last_incident": { + "description": "Timestamp of last incident", + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "risk_evaluation": { + "description": "Risk assessment details, if available.", + "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" + } + ] + }, + "metrics": { + "type": "object", + "properties": { + "total_content": { + "description": "Total pieces of content", + "type": "number" + }, + "flagged_content": { + "description": "Number of flagged content pieces", + "type": "number" + }, + "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": { + "description": "Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process.", + "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": {} + } + }, + "required": [ + "id", + "first_seen", + "last_seen", + "status", + "trust_level", + "block", + "risk_evaluation", + "metrics", + "metadata" + ], + "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.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)" + } + ] + }, + "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';\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)" + } + ] + } + }, + "/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": { + "description": "The queue ID", + "type": "string" + }, + "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';\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)" + } + ] + } + }, + "/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": { + "description": "The queue ID", + "type": "string" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "query", + "name": "withinDays", + "schema": { + "description": "Number of days to analyze statistics for", + "default": "30", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reviewStats": { + "type": "object", + "properties": { + "averageTimeToReview": { + "description": "Average time in milliseconds to review an item", + "type": "number" + }, + "totalReviewed": { + "description": "Total number of items reviewed", + "type": "number" + }, + "totalPending": { + "description": "Total number of items pending review", + "type": "number" + } + }, + "required": [ + "averageTimeToReview", + "totalReviewed", + "totalPending" + ], + "additionalProperties": false + }, + "actionStats": { + "type": "array", + "items": { + "type": "object", + "properties": { + "actionId": { + "description": "ID of the moderation action", + "type": "string" + }, + "actionName": { + "description": "Name of the moderation action", + "type": "string" + }, + "count": { + "description": "Number of times this action was taken", + "type": "number" + }, + "percentageOfTotal": { + "description": "Percentage this action represents of all actions", + "type": "number" + } + }, + "required": [ + "actionId", + "actionName", + "count", + "percentageOfTotal" + ], + "additionalProperties": false + } + }, + "topReviewers": { + "description": "List of top reviewers and their statistics", + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "description": "ID of the reviewer", + "type": "string" + }, + "name": { + "description": "Name of the reviewer", + "type": "string" + }, + "reviewCount": { + "description": "Number of items reviewed", + "type": "number" + }, + "averageTimePerReview": { + "description": "Average review time in milliseconds", + "type": "number" + }, + "accuracyScore": { + "description": "Optional accuracy score based on review quality metrics", + "type": "number" + }, + "topActions": { + "description": "Most common actions taken by this reviewer", + "type": "array", + "items": { + "type": "object", + "properties": { + "actionId": { + "description": "Most used action by this reviewer", + "type": "string" + }, + "actionName": { + "description": "Name of the most used action", + "type": "string" + }, + "count": { + "description": "Number of times this action was used", + "type": "number" + } + }, + "required": [ + "actionId", + "actionName", + "count" + ], + "additionalProperties": false + } + } + }, + "required": [ + "userId", + "name", + "reviewCount", + "averageTimePerReview", + "topActions" + ], + "additionalProperties": false + } + }, + "trends": { + "type": "object", + "properties": { + "dailyReviewCounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "description": "Date in YYYY-MM-DD format", + "type": "string" + }, + "count": { + "description": "Number of reviews on this date", + "type": "number" + } + }, + "required": [ + "date", + "count" + ], + "additionalProperties": false + } + }, + "flaggedContentTrends": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "description": "Content flag/label", + "type": "string" + }, + "trend": { + "description": "Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing", + "type": "number" + } + }, + "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)" + } + ] + } + }, + "/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": { + "description": "The queue ID", + "type": "string" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "query", + "name": "pageSize", + "schema": { + "description": "Number of items per page", + "default": 20, + "type": "number" + } + }, + { + "in": "query", + "name": "pageNumber", + "schema": { + "description": "Page number to fetch", + "default": 1, + "type": "number" + } + }, + { + "in": "query", + "name": "sortField", + "schema": { + "type": "string", + "enum": [ + "createdAt", + "severity", + "reviewedAt" + ] + } + }, + { + "in": "query", + "name": "sortDirection", + "schema": { + "description": "Sort direction", + "default": "desc", + "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": { + "description": "Content ID", + "type": "string" + }, + "content": { + "description": "The content to be moderated", + "type": "string" + }, + "language": { + "description": "Content language", + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "description": "Label name", + "type": "string" + }, + "score": { + "description": "Confidence score of the label", + "type": "number" + }, + "flagged": { + "description": "Whether this label caused a flag", + "type": "boolean" + } + }, + "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": { + "description": "Action ID", + "type": "string" + }, + "name": { + "description": "Action name", + "type": "string" + }, + "comment": { + "description": "Action comment", + "type": "string" + }, + "timestamp": { + "description": "Unix timestamp of when the action was taken", + "type": "number" + }, + "reviewer": { + "description": "Moderator userID", + "type": "string" + } + }, + "required": [ + "id", + "name", + "timestamp" + ], + "additionalProperties": false + } + }, + "flagged": { + "description": "Whether the item is flagged by any label", + "type": "boolean" + }, + "status": { + "description": "Status of the item", + "type": "string", + "enum": [ + "pending", + "resolved" + ] + }, + "timestamp": { + "description": "Unix timestamp of when the item was created", + "type": "number" + }, + "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)" + } + ] + } + }, + "/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": { + "description": "The queue ID", + "type": "string" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "path", + "name": "itemId", + "schema": { + "description": "The item ID to resolve", + "type": "string" + }, + "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": { + "description": "Timestamp when the item was resolved", + "type": "string" + }, + "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)" + } + ] + } + }, + "/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": { + "description": "The queue ID", + "type": "string" + }, + "required": true, + "description": "The queue ID" + }, + { + "in": "path", + "name": "itemId", + "schema": { + "description": "The item ID to unresolve", + "type": "string" + }, + "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": { + "description": "New status of the item", + "type": "string" + }, + "unresolvedAt": { + "description": "Timestamp when the item was unresolved", + "type": "string" + } + }, + "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)" + } + ] + } + }, + "/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": { + "description": "List of moderation actions with their associated webhooks", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "The ID of the action.", + "type": "string" + }, + "key": { + "description": "User defined key of the action.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "description": "The name of the action.", + "type": "string" + }, + "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": { + "description": "Whether the action is a built-in action or a custom one.", + "default": false, + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "queueBehaviour": { + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "default": "NO_CHANGE", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "description": "The IDs of the queues the action is available in.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "default": "ALL_QUEUES", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The value of the action.", + "type": "string" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "description": "Whether the action requires a value to be executed.", + "default": false, + "type": "boolean" + }, + "freeText": { + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "default": false, + "type": "boolean" + }, + "webhooks": { + "description": "The action's webhooks.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The webhook's name, used to identify it in the dashboard", + "type": "string" + }, + "description": { + "description": "The webhook's description", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "url": { + "description": "The webhook's URL. We'll call this URL when the event occurs.", + "type": "string", + "format": "uri" + }, + "moderationActionId": { + "description": "The ID of the moderation action to trigger the webhook on. Only used for moderation action webhooks.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The ID of the webhook.", + "type": "string" + } + }, + "required": [ + "name", + "url", + "id" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText", + "webhooks" + ], + "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 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)" + } + ] + }, + "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": { + "description": "The name of the action.", + "type": "string" + }, + "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": { + "description": "Whether the action is a built-in action or a custom one.", + "default": false, + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "queueBehaviour": { + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "default": "NO_CHANGE", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "description": "The IDs of the queues the action is available in.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "default": "ALL_QUEUES", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The value of the action.", + "type": "string" + } + }, + "required": [ + "value" + ] + } + }, + "valueRequired": { + "description": "Whether the action requires a value to be executed.", + "default": false, + "type": "boolean" + }, + "freeText": { + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "default": false, + "type": "boolean" + }, + "webhooks": { + "description": "The action's webhooks.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The webhook's name, used to identify it in the dashboard", + "type": "string" + }, + "description": { + "description": "The webhook's description", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "url": { + "description": "The webhook's URL. We'll call this URL when the event occurs.", + "type": "string", + "format": "uri" + }, + "id": { + "description": "ID of an existing webhook or undefined if this is a new webhook.", + "type": "string" + } + }, + "required": [ + "name", + "url" + ] + } + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Action created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "The ID of the action.", + "type": "string" + }, + "key": { + "description": "User defined key of the action.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "description": "The name of the action.", + "type": "string" + }, + "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": { + "description": "Whether the action is a built-in action or a custom one.", + "default": false, + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "queueBehaviour": { + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "default": "NO_CHANGE", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "description": "The IDs of the queues the action is available in.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "default": "ALL_QUEUES", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The value of the action.", + "type": "string" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "description": "Whether the action requires a value to be executed.", + "default": false, + "type": "boolean" + }, + "freeText": { + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "default": false, + "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)" + } + ] + } + }, + "/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": { + "description": "The ID of the action to get.", + "type": "string" + }, + "required": true, + "description": "The ID of the action to get." + } + ], + "responses": { + "200": { + "description": "Action retrieved successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "The ID of the action.", + "type": "string" + }, + "key": { + "description": "User defined key of the action.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "description": "The name of the action.", + "type": "string" + }, + "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": { + "description": "Whether the action is a built-in action or a custom one.", + "default": false, + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "queueBehaviour": { + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "default": "NO_CHANGE", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "description": "The IDs of the queues the action is available in.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "default": "ALL_QUEUES", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The value of the action.", + "type": "string" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "description": "Whether the action requires a value to be executed.", + "default": false, + "type": "boolean" + }, + "freeText": { + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "default": false, + "type": "boolean" + }, + "webhooks": { + "description": "The action's webhooks.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The webhook's name, used to identify it in the dashboard", + "type": "string" + }, + "description": { + "description": "The webhook's description", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "url": { + "description": "The webhook's URL. We'll call this URL when the event occurs.", + "type": "string", + "format": "uri" + }, + "moderationActionId": { + "description": "The ID of the moderation action to trigger the webhook on. Only used for moderation action webhooks.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The ID of the webhook.", + "type": "string" + } + }, + "required": [ + "name", + "url", + "id" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "createdAt", + "name", + "builtIn", + "queueBehaviour", + "filterInQueueIds", + "position", + "possibleValues", + "valueRequired", + "freeText", + "webhooks" + ], + "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)" + } + ] + }, + "put": { + "operationId": "actions-update", + "summary": "Update an action", + "description": "Update an action.", + "tags": [ + "Actions" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "description": "The ID of the action to update.", + "type": "string" + }, + "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": { + "description": "The name of the action.", + "type": "string" + }, + "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": { + "description": "Whether the action is a built-in action or a custom one.", + "default": false, + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "queueBehaviour": { + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "default": "NO_CHANGE", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "description": "The IDs of the queues the action is available in.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "default": "ALL_QUEUES", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The value of the action.", + "type": "string" + } + }, + "required": [ + "value" + ] + } + }, + "valueRequired": { + "description": "Whether the action requires a value to be executed.", + "default": false, + "type": "boolean" + }, + "freeText": { + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "default": false, + "type": "boolean" + }, + "webhooks": { + "description": "The action's webhooks.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The webhook's name, used to identify it in the dashboard", + "type": "string" + }, + "description": { + "description": "The webhook's description", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "url": { + "description": "The webhook's URL. We'll call this URL when the event occurs.", + "type": "string", + "format": "uri" + }, + "id": { + "description": "ID of an existing webhook or undefined if this is a new webhook.", + "type": "string" + } + }, + "required": [ + "name", + "url" + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "The ID of the action.", + "type": "string" + }, + "key": { + "description": "User defined key of the action.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "description": "The date the action was created.", + "type": "string" + }, + "name": { + "description": "The name of the action.", + "type": "string" + }, + "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": { + "description": "Whether the action is a built-in action or a custom one.", + "default": false, + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "queueBehaviour": { + "description": "Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.", + "default": "NO_CHANGE", + "type": "string", + "enum": [ + "REMOVE", + "ADD", + "NO_CHANGE" + ] + }, + "filterInQueueIds": { + "description": "The IDs of the queues the action is available in.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "description": "Show the action in all queues, selected queues or no queues (to use via API only).", + "default": "ALL_QUEUES", + "type": "string", + "enum": [ + "ALL_QUEUES", + "SOME_QUEUES", + "HIDDEN" + ] + }, + "possibleValues": { + "description": "The possible values of the action. The user will be prompted to select one of these values when executing the action.", + "default": [], + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "description": "The value of the action.", + "type": "string" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "valueRequired": { + "description": "Whether the action requires a value to be executed.", + "default": false, + "type": "boolean" + }, + "freeText": { + "description": "Whether the action allows any text to be entered as a value or if it must be one of the possible values.", + "default": false, + "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)" + } + ] + }, + "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": { + "description": "The ID of the action to delete.", + "type": "string" + }, + "required": true, + "description": "The ID of the action to delete." + } + ], + "responses": { + "200": { + "description": "Action deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "description": "Whether the action was deleted.", + "type": "boolean" + }, + "id": { + "description": "The ID of the action.", + "type": "string" + } + }, + "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)" + } + ] + } + }, + "/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": { + "description": "Input parameters", + "type": "object", + "properties": { + "actionKey": { + "description": "ID or key of the action to execute", + "type": "string" + }, + "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" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "description": "Execution result", + "type": "object", + "properties": { + "success": { + "description": "Whether the action was executed successfully", + "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" + } + } + } + }, + "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)" + } + ] + } + }, + "/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": { + "description": "The ID or key of the action to execute.", + "type": "string" + }, + "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": { + "description": "Action executed successfully.", + "type": "boolean" + }, + "actionId": { + "description": "The ID of the action.", + "type": "string" + }, + "ids": { + "description": "The IDs of the content items.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "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)" + } + ] + } + }, + "/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": { + "description": "Input parameters for text moderation", + "type": "object", + "properties": { + "contentId": { + "description": "The unique ID of the content in your database.", + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "value": { + "description": "The text you'd like to analyze. We recommend to submit plain text or HTML", + "type": "string", + "minLength": 1, + "maxLength": 100000 + }, + "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" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "description": "Moderation analysis results including model outputs and detected patterns", + "allOf": [ + { + "type": "object", + "properties": { + "status": { + "description": "Success if the request was successful", + "type": "string" + }, + "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": { + "description": "Information about the request", + "type": "object", + "properties": { + "timestamp": { + "description": "The timestamp of the request", + "type": "number" + }, + "quota_usage": { + "description": "The quota usage of the request", + "type": "number" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false + }, + "flagged": { + "description": "Whether the content was flagged by any models", + "type": "boolean" + }, + "author": { + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "external_id": { + "description": "The author's ID from your system", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "content_moderated": { + "description": "Whether the content was moderated or not. Same as `content` !== `original`", + "type": "boolean" + }, + "unicode_spoofing": { + "description": "Whether the content is using look-alike characters. Often used by spammers.", + "type": "boolean" + }, + "data_found": { + "description": "Whether any entity matchers found data for the content", + "type": "boolean" + }, + "original": { + "description": "The original content", + "type": "string" + }, + "content": { + "description": "The content after moderation. With all mask replacements applied and look-alike characters replaced with the original characters.", + "type": "string" + }, + "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": { + "description": "The flagging mode.", + "type": "string", + "enum": [ + "BLOCK_LIST", + "REQUIRE_LIST", + "PASS_LIST" + ] + }, + "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": { + "description": "Whether the wordlists flagged the content.", + "type": "boolean" + }, + "name": { + "description": "The name of the wordlist", + "type": "string" + }, + "id": { + "description": "The ID of the wordlist", + "type": "string" + }, + "score": { + "description": "The score of the wordlist", + "type": "number" + } + }, + "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": {} + } + ] + } + } + } + }, + "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": { + "description": "The object you want to analyze.", + "type": "object", + "properties": { + "type": { + "description": "The type of the object you want to analyze.", + "type": "string", + "enum": [ + "profile", + "event", + "product", + "object" + ] + }, + "data": { + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "object", + "properties": { + "type": { + "description": "The type of content (e.g., \"text\", \"image\", \"video\")", + "type": "string", + "enum": [ + "text", + "image", + "video", + "audio" + ] + }, + "modelIds": { + "description": "Optional array of specific model IDs to use", + "type": "array", + "items": { + "type": "string" + } + }, + "value": { + "description": "The content to analyze", + "type": "string" + } + }, + "required": [ + "type", + "value" + ] + } + } + }, + "required": [ + "type", + "data" + ] + } + }, + "required": [ + "value" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "status": { + "description": "Success if the request was successful", + "type": "string" + }, + "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": { + "description": "Information about the request", + "type": "object", + "properties": { + "timestamp": { + "description": "The timestamp of the request", + "type": "number" + }, + "quota_usage": { + "description": "The quota usage of the request", + "type": "number" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false + }, + "flagged": { + "description": "Whether the content was flagged by any models", + "type": "boolean" + }, + "author": { + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "external_id": { + "description": "The author's ID from your system", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "unicode_spoofing": { + "description": "Whether the content is using look-alike characters. Often used by spammers.", + "type": "boolean" + }, + "data_found": { + "description": "Whether any entity matchers found data for the content", + "type": "boolean" + }, + "labels": { + "description": "The scores of each label", + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "description": "The label of the model", + "type": "string" + }, + "model": { + "description": "The model that found the label", + "type": "string" + }, + "score": { + "description": "The confidence of the model", + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "label", + "model", + "score" + ], + "additionalProperties": false + } + }, + "entities": { + "description": "The entities found in the content", + "type": "array", + "items": { + "type": "object", + "properties": { + "model": { + "description": "The model that found the entity", + "type": "string" + }, + "matches": { + "description": "The matches of the entity", + "type": "array", + "items": { + "type": "string" + } + }, + "score": { + "description": "The similarity score of the matches", + "type": "number" + } + }, + "required": [ + "model", + "matches" + ], + "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": { + "description": "The flagging mode.", + "type": "string", + "enum": [ + "BLOCK_LIST", + "REQUIRE_LIST", + "PASS_LIST" + ] + }, + "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": { + "description": "Whether the wordlists flagged the content.", + "type": "boolean" + }, + "name": { + "description": "The name of the wordlist", + "type": "string" + }, + "id": { + "description": "The ID of the wordlist", + "type": "string" + }, + "score": { + "description": "The score of the wordlist", + "type": "number" + } + }, + "required": [ + "mode", + "flagged", + "name", + "id", + "score" + ], + "additionalProperties": false + } + }, + "fields": { + "description": "The fields in the object and their flags", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "description": "The key of the field", + "type": "string" + }, + "flagged": { + "description": "Whether the field was flagged", + "type": "boolean" + }, + "flagged_by": { + "description": "The models that flagged the field", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "key", + "flagged", + "flagged_by" + ], + "additionalProperties": false + } + } + }, + "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": { + "description": "The URL of the image you want to analyze.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "url" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "description": "Success if the request was successful", + "type": "string" + }, + "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": { + "description": "Information about the request", + "type": "object", + "properties": { + "timestamp": { + "description": "The timestamp of the request", + "type": "number" + }, + "quota_usage": { + "description": "The quota usage of the request", + "type": "number" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false + }, + "flagged": { + "description": "Whether the content was flagged by any models", + "type": "boolean" + }, + "author": { + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "external_id": { + "description": "The author's ID from your system", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "labels": { + "description": "The scores of each label", + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "description": "The label of the model", + "type": "string", + "enum": [ + "nudity", + "suggestive", + "gore", + "hate", + "violence", + "weapon", + "smoking", + "drugs", + "alcohol", + "text", + "toxic" + ] + }, + "score": { + "description": "The confidence of the model", + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "label", + "score" + ], + "additionalProperties": false + } + }, + "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": { + "description": "Input parameters for video moderation", + "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": { + "description": "The URL of the video you want to analyze.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "url" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "status": { + "description": "Success if the request was successful", + "type": "string" + }, + "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": { + "description": "Information about the request", + "type": "object", + "properties": { + "timestamp": { + "description": "The timestamp of the request", + "type": "number" + }, + "quota_usage": { + "description": "The quota usage of the request", + "type": "number" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false + }, + "flagged": { + "description": "Whether the content was flagged by any models", + "type": "boolean" + }, + "author": { + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "external_id": { + "description": "The author's ID from your system", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + } + }, + "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": { + "description": "Input parameters for audio moderation", + "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": { + "description": "The URL of the audio you want to analyze.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "url" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "description": "Audio moderation analysis results", + "type": "object", + "properties": { + "status": { + "description": "Success if the request was successful", + "type": "string" + }, + "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": { + "description": "Information about the request", + "type": "object", + "properties": { + "timestamp": { + "description": "The timestamp of the request", + "type": "number" + }, + "quota_usage": { + "description": "The quota usage of the request", + "type": "number" + } + }, + "required": [ + "timestamp", + "quota_usage" + ], + "additionalProperties": false + }, + "flagged": { + "description": "Whether the content was flagged by any models", + "type": "boolean" + }, + "author": { + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "external_id": { + "description": "The author's ID from your system", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "status", + "request", + "flagged", + "author" + ], + "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" + } + } + } + } + } + } + }, + "/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": { + "description": "ID of the account", + "type": "string" + }, + "paid_plan_name": { + "description": "Name of the paid plan", + "type": "string" + }, + "text_api_quota": { + "description": "Text API quota", + "type": "number" + }, + "remaining_quota": { + "description": "Remaining quota", + "type": "number" + }, + "current_project": { + "type": "object", + "properties": { + "id": { + "description": "ID of the current project", + "type": "string" + }, + "name": { + "description": "Name of the current project", + "type": "string" + } + }, + "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)" + } + ] + } + }, + "/auth": { + "get": { + "operationId": "account-legacyAuthGet", + "security": [ + { + "Authorization": [] + } + ], + "deprecated": true, + "parameters": [], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "description": "Status of the authentication", + "type": "string" + }, + "message": { + "description": "Message of the authentication", + "type": "string" + } + }, + "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)" + } + ] + }, + "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": { + "description": "Status of the authentication", + "type": "string" + }, + "message": { + "description": "Message of the authentication", + "type": "string" + }, + "project": { + "description": "Name of the authenticated project", + "type": "string" + } + }, + "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)" + } + ] + } + }, + "/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": { + "description": "Array of wordlists", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the wordlist", + "type": "string" + }, + "name": { + "description": "Name of the wordlist", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "description": { + "description": "Description of the wordlist", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "description": "When the wordlist was created", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "userId": { + "description": "User who created the wordlist", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "name", + "description", + "createdAt", + "userId" + ], + "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" + } + } + } + }, + "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)" + } + ] + } + }, + "/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": { + "description": "ID of the wordlist to get", + "type": "string" + }, + "required": true, + "description": "ID of the wordlist to get" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "description": "ID of the wordlist", + "type": "string" + }, + "name": { + "anyOf": [ + { + "description": "Name of the wordlist", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "words": { + "description": "Words in the wordlist", + "type": "array", + "items": { + "type": "string" + } + }, + "createdAt": { + "description": "Creation date of the wordlist", + "type": "string" + }, + "organizationId": { + "description": "ID of the organization", + "type": "string" + }, + "userId": { + "anyOf": [ + { + "description": "ID of the user", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "strict": { + "description": "Strict mode", + "type": "boolean" + } + }, + "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)" + } + ] + }, + "put": { + "operationId": "wordlist-update", + "summary": "Update wordlist", + "description": "Update a wordlist", + "tags": [ + "wordlist" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "description": "ID of the wordlist to update", + "type": "string" + }, + "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": { + "description": "ID of the wordlist", + "type": "string" + }, + "name": { + "anyOf": [ + { + "description": "Name of the wordlist", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "words": { + "description": "Words in the wordlist", + "type": "array", + "items": { + "type": "string" + } + }, + "createdAt": { + "description": "Creation date of the wordlist", + "type": "string" + }, + "organizationId": { + "description": "ID of the organization", + "type": "string" + }, + "userId": { + "anyOf": [ + { + "description": "ID of the user", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "strict": { + "description": "Strict mode", + "type": "boolean" + } + }, + "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)" + } + ] + } + }, + "/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": { + "description": "ID of the wordlist to check embedding status for", + "type": "string" + }, + "required": true, + "description": "ID of the wordlist to check embedding status for" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "description": "Embedding status details", + "type": "object", + "properties": { + "progress": { + "description": "Percentage of words that have been embedded (0-100)", + "type": "number" + }, + "totalWords": { + "description": "Total number of words in the wordlist", + "type": "number" + }, + "remainingWords": { + "description": "Number of words still waiting to be embedded", + "type": "number" + } + }, + "required": [ + "progress", + "totalWords", + "remainingWords" + ], + "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.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)" + } + ] + } + }, + "/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": { + "description": "ID of the wordlist to add words to", + "type": "string" + }, + "required": true, + "description": "ID of the wordlist to add words to" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "words": { + "description": "Array of words to add to the wordlist. Duplicate words will be ignored.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "words" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Words successfully added to wordlist", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "addedCount": { + "description": "Number of words added", + "type": "number" + }, + "totalCount": { + "description": "Total number of words in wordlist", + "type": "number" + }, + "addedWords": { + "description": "List of words that were added", + "type": "array", + "items": { + "type": "string" + } + } + }, + "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)" + } + ] + }, + "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": { + "description": "ID of the wordlist to remove words from", + "type": "string" + }, + "required": true, + "description": "ID of the wordlist to remove words from" + }, + { + "in": "query", + "name": "words", + "schema": { + "description": "Array of words to remove from the wordlist", + "type": "array", + "items": { + "type": "string" + } + }, + "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": { + "description": "Number of words removed", + "type": "number" + }, + "totalCount": { + "description": "Total number of words in wordlist", + "type": "number" + }, + "removedWords": { + "description": "List of words removed", + "type": "array", + "items": { + "type": "string" + } + } + }, + "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)" + } + ] + } + }, + "/moderate": { + "post": { + "operationId": "newModerate-moderate", + "security": [ + { + "Authorization": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "description": "The content sent for moderation", + "oneOf": [ + { + "description": "Text", + "title": "Text", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "description": "The content text", + "type": "string", + "minLength": 1, + "maxLength": 100000 + } + }, + "required": [ + "type", + "text" + ] + }, + { + "description": "Image", + "title": "Image", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ] + }, + { + "description": "Video", + "title": "Video", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "description": "A public URL of the video content", + "type": "string", + "format": "uri" + } + }, + "required": [ + "type", + "url" + ] + }, + { + "description": "Audio", + "title": "Audio", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "description": "The URL of the audio content", + "type": "string", + "format": "uri" + } + }, + "required": [ + "type", + "url" + ] + }, + { + "description": "Object", + "title": "Object", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "data": { + "description": "Values in the object. Can be mixed content types.", + "type": "object", + "propertyNames": { + "description": "The key of the content node", + "type": "string" + }, + "additionalProperties": { + "title": "Content leaf", + "oneOf": [ + { + "description": "Text", + "title": "Text", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "description": "The content text", + "type": "string", + "minLength": 1, + "maxLength": 100000 + } + }, + "required": [ + "type", + "text" + ] + }, + { + "description": "Image", + "title": "Image", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ] + }, + { + "description": "Video", + "title": "Video", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "description": "A public URL of the video content", + "type": "string", + "format": "uri" + } + }, + "required": [ + "type", + "url" + ] + }, + { + "description": "Audio", + "title": "Audio", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "description": "The URL of the audio content", + "type": "string", + "format": "uri" + } + }, + "required": [ + "type", + "url" + ] + } + ], + "type": "object" + } + } + }, + "required": [ + "type", + "data" + ] + } + ], + "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", + "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": {} + }, + "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": [ + { + "title": "Toxicity", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "toxicity" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Personal Information", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "personal_information" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Toxicity Severe", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "toxicity_severe" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Hate", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "hate" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Illicit", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Illicit Drugs", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_drugs" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Illicit Alcohol", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_alcohol" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Illicit Firearms", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_firearms" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Illicit Tobacco", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_tobacco" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Illicit Gambling", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "illicit_gambling" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Cannabis", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "cannabis" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Adult", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "adult" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Crypto", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "crypto" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Sexual", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "sexual" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Flirtation", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "flirtation" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Profanity", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "profanity" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Violence", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "violence" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Self Harm", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "self_harm" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Spam", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "spam" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Self Promotion", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "self_promotion" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Political", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "political" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Religion", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "religion" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "Code Abuse", + "type": "object", + "properties": { + "flag": { + "type": "boolean" + }, + "threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "id": { + "type": "string", + "const": "code_abuse" + } + }, + "required": [ + "flag", + "id" + ] + }, + { + "title": "PII Masking", + "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": "URL 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": "Guideline", + "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" + ] + } + ], + "type": "object" + } + } + }, + "required": [ + "content" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "description": "Potentially modified content.", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier for the content. Either the contentId provided by you or an autogenerated ID.", + "type": "string" + }, + "masked": { + "description": "Whether any values have been masked.", + "type": "boolean" + }, + "modified": { + "description": "The modified content, if any.", + "anyOf": [ + { + "anyOf": [ + { + "title": "Modified string content", + "type": "string" + }, + { + "title": "Modified object content", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + { + "title": "Modified nested object content", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "title": "Content leaf", + "oneOf": [ + { + "description": "Text", + "title": "Text", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "description": "The content text", + "type": "string", + "minLength": 1, + "maxLength": 100000 + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false + }, + { + "description": "Image", + "title": "Image", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "url": { + "description": "A public URL of the image content", + "type": "string", + "format": "uri" + }, + "data": { + "description": "Base64-encoded image data", + "type": "string", + "maxLength": 5500000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "description": "Video", + "title": "Video", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "video" + }, + "url": { + "description": "A public URL of the video content", + "type": "string", + "format": "uri" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false + }, + { + "description": "Audio", + "title": "Audio", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + }, + "url": { + "description": "The URL of the audio content", + "type": "string", + "format": "uri" + } + }, + "required": [ + "type", + "url" + ], + "additionalProperties": false + } + ], + "type": "object" + } + } + ] + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "masked", + "modified" + ], + "additionalProperties": false + }, + "author": { + "description": "The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.", + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "description": "Author ID in Moderation API", + "type": "string" + }, + "external_id": { + "description": "The author's ID from your system", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "block": { + "description": "Block or suspension details, if applicable. Null if the author is enabled.", + "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" + } + ] + }, + "status": { + "description": "Current author status", + "type": "string", + "enum": [ + "enabled", + "suspended", + "blocked" + ] + }, + "trust_level": { + "type": "object", + "properties": { + "level": { + "description": "Author trust level (-1, 0, 1, 2, 3, or 4)", + "type": "number" + }, + "manual": { + "description": "True if the trust level was set manually by a moderator", + "type": "boolean" + } + }, + "required": [ + "level", + "manual" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "block", + "status", + "trust_level" + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "evaluation": { + "description": "The evaluation of the content after running the channel policies.", + "type": "object", + "properties": { + "flagged": { + "description": "Whether the content was flagged by any policy.", + "type": "boolean" + }, + "flag_probability": { + "description": "The probability that the content should be flagged.", + "type": "number" + }, + "severity_score": { + "description": "The severity score of the content. A higher score indicates more severe content.", + "type": "number" + }, + "unicode_spoofed": { + "description": "Whether the content was flagged for Unicode spoofing.", + "type": "boolean" + } + }, + "required": [ + "flagged", + "flag_probability", + "severity_score" + ], + "additionalProperties": false + }, + "recommendation": { + "description": "The recommendation for the content based on the evaluation.", + "type": "object", + "properties": { + "action": { + "description": "The action to take based on the recommendation", + "type": "string", + "enum": [ + "review", + "allow", + "reject" + ] + }, + "reason_codes": { + "description": "The reason code for the recommendation. Can be used to display a reason to the user.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "severity_reject", + "severity_review", + "author_block", + "dry_run", + "trusted_allow", + "untrusted_severity" + ] + } + } + }, + "required": [ + "action", + "reason_codes" + ], + "additionalProperties": false + }, + "policies": { + "description": "Results of all policies in the channel. Sorted by highest probability.", + "type": "array", + "items": { + "description": "Policy output schema.", + "oneOf": [ + { + "description": "Classifier policy.", + "title": "Classifier output", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier for the classifier output.", + "type": "string" + }, + "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 + } + } + }, + "required": [ + "id", + "type", + "probability", + "flagged" + ], + "additionalProperties": false + }, + { + "description": "Entity matcher policy.", + "title": "Entity matcher 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 + } + } + }, + "required": [ + "probability", + "match", + "span" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "type", + "probability", + "flagged", + "matches" + ], + "additionalProperties": false + } + ], + "type": "object" + } + }, + "insights": { + "description": "Results of all insights enabled in the channel.", + "type": "array", + "items": { + "oneOf": [ + { + "description": "Sentiment insight", + "title": "Sentiment insight", + "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": "Language insight", + "title": "Language 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 + } + ], + "type": "object" + } + }, + "meta": { + "description": "Metadata about the moderation request", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success", + "partial_success" + ] + }, + "timestamp": { + "type": "number" + }, + "channel_key": { + "description": "The unique key of the channel where the content was handled. Either the channel provided by you or automatically routed.", + "type": "string" + }, + "usage": { + "type": "number" + }, + "processing_time": { + "type": "string" + } + }, + "required": [ + "status", + "timestamp", + "channel_key", + "usage" + ], + "additionalProperties": false + }, + "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';\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: 'x', 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\": \"x\",\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: \"x\", type: :text})\n\nputs(response)" + } + ] + } + } + }, + "components": { + "schemas": { + "error.BAD_REQUEST": { + "title": "Invalid input data error (400)", + "description": "The error information", + "example": { + "code": "BAD_REQUEST", + "message": "Invalid input data", + "issues": [] + }, + "type": "object", + "properties": { + "message": { + "description": "The error message", + "example": "Invalid input data", + "type": "string" + }, + "code": { + "description": "The error code", + "example": "BAD_REQUEST", + "type": "string" + }, + "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 + }, + "error.UNAUTHORIZED": { + "title": "Authorization not provided error (401)", + "description": "The error information", + "example": { + "code": "UNAUTHORIZED", + "message": "Authorization not provided", + "issues": [] + }, + "type": "object", + "properties": { + "message": { + "description": "The error message", + "example": "Authorization not provided", + "type": "string" + }, + "code": { + "description": "The error code", + "example": "UNAUTHORIZED", + "type": "string" + }, + "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 + }, + "error.FORBIDDEN": { + "title": "Insufficient access error (403)", + "description": "The error information", + "example": { + "code": "FORBIDDEN", + "message": "Insufficient access", + "issues": [] + }, + "type": "object", + "properties": { + "message": { + "description": "The error message", + "example": "Insufficient access", + "type": "string" + }, + "code": { + "description": "The error code", + "example": "FORBIDDEN", + "type": "string" + }, + "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 + }, + "error.NOT_FOUND": { + "title": "Not found error (404)", + "description": "The error information", + "example": { + "code": "NOT_FOUND", + "message": "Not found", + "issues": [] + }, + "type": "object", + "properties": { + "message": { + "description": "The error message", + "example": "Not found", + "type": "string" + }, + "code": { + "description": "The error code", + "example": "NOT_FOUND", + "type": "string" + }, + "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 + }, + "error.INTERNAL_SERVER_ERROR": { + "title": "Internal server error error (500)", + "description": "The error information", + "example": { + "code": "INTERNAL_SERVER_ERROR", + "message": "Internal server error", + "issues": [] + }, + "type": "object", + "properties": { + "message": { + "description": "The error message", + "example": "Internal server error", + "type": "string" + }, + "code": { + "description": "The error code", + "example": "INTERNAL_SERVER_ERROR", + "type": "string" + }, + "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 + }, + "error.CONFLICT": { + "title": "Action with this key already exists error (409)", + "description": "The error information", + "example": { + "code": "CONFLICT", + "message": "Action with this key already exists", + "issues": [] + }, + "type": "object", + "properties": { + "message": { + "description": "The error message", + "example": "Action with this key already exists", + "type": "string" + }, + "code": { + "description": "The error code", + "example": "CONFLICT", + "type": "string" + }, + "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 + } + }, + "securitySchemes": { + "Authorization": { + "type": "http", + "scheme": "bearer" + } + } + } +} \ No newline at end of file