Class Response.Moderation.Output.ModerationResult
-
- All Implemented Interfaces:
public final class Response.Moderation.Output.ModerationResultA moderation result produced for the response input or output.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classResponse.Moderation.Output.ModerationResult.BuilderA builder for ModerationResult.
public final classResponse.Moderation.Output.ModerationResult.CategoriesA dictionary of moderation categories to booleans, True if the input is flagged under this category.
public final classResponse.Moderation.Output.ModerationResult.CategoryAppliedInputTypesWhich modalities of input are reflected by the score for each category.
public final classResponse.Moderation.Output.ModerationResult.CategoryScoresA dictionary of moderation categories to scores.
-
Method Summary
Modifier and Type Method Description final Response.Moderation.Output.ModerationResult.Categoriescategories()A dictionary of moderation categories to booleans, True if the input is flagged under this category. final Response.Moderation.Output.ModerationResult.CategoryAppliedInputTypescategoryAppliedInputTypes()Which modalities of input are reflected by the score for each category. final Response.Moderation.Output.ModerationResult.CategoryScorescategoryScores()A dictionary of moderation categories to scores. final Booleanflagged()A boolean indicating whether the content was flagged by any category. final Stringmodel()The moderation model that produced this result. final JsonValue_type()The object type, which was always moderation_resultfor successful moderation results.final JsonField<Response.Moderation.Output.ModerationResult.Categories>_categories()Returns the raw JSON value of categories. final JsonField<Response.Moderation.Output.ModerationResult.CategoryAppliedInputTypes>_categoryAppliedInputTypes()Returns the raw JSON value of categoryAppliedInputTypes. final JsonField<Response.Moderation.Output.ModerationResult.CategoryScores>_categoryScores()Returns the raw JSON value of categoryScores. final JsonField<Boolean>_flagged()Returns the raw JSON value of flagged. final JsonField<String>_model()Returns the raw JSON value of model. final Map<String, JsonValue>_additionalProperties()final Response.Moderation.Output.ModerationResult.BuildertoBuilder()final Response.Moderation.Output.ModerationResultvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Response.Moderation.Output.ModerationResult.Builderbuilder()Returns a mutable builder for constructing an instance of ModerationResult. -
-
Method Detail
-
categories
final Response.Moderation.Output.ModerationResult.Categories categories()
A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
categoryAppliedInputTypes
final Response.Moderation.Output.ModerationResult.CategoryAppliedInputTypes categoryAppliedInputTypes()
Which modalities of input are reflected by the score for each category.
-
categoryScores
final Response.Moderation.Output.ModerationResult.CategoryScores categoryScores()
A dictionary of moderation categories to scores.
-
flagged
final Boolean flagged()
A boolean indicating whether the content was flagged by any category.
-
_type
final JsonValue _type()
The object type, which was always
moderation_resultfor successful moderation results.Expected to always return the following:
JsonValue.from("moderation_result")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_categories
final JsonField<Response.Moderation.Output.ModerationResult.Categories> _categories()
Returns the raw JSON value of categories.
Unlike categories, this method doesn't throw if the JSON field has an unexpected type.
-
_categoryAppliedInputTypes
final JsonField<Response.Moderation.Output.ModerationResult.CategoryAppliedInputTypes> _categoryAppliedInputTypes()
Returns the raw JSON value of categoryAppliedInputTypes.
Unlike categoryAppliedInputTypes, this method doesn't throw if the JSON field has an unexpected type.
-
_categoryScores
final JsonField<Response.Moderation.Output.ModerationResult.CategoryScores> _categoryScores()
Returns the raw JSON value of categoryScores.
Unlike categoryScores, this method doesn't throw if the JSON field has an unexpected type.
-
_flagged
final JsonField<Boolean> _flagged()
Returns the raw JSON value of flagged.
Unlike flagged, this method doesn't throw if the JSON field has an unexpected type.
-
_model
final JsonField<String> _model()
Returns the raw JSON value of model.
Unlike model, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Response.Moderation.Output.ModerationResult.Builder toBuilder()
-
validate
final Response.Moderation.Output.ModerationResult validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static Response.Moderation.Output.ModerationResult.Builder builder()
Returns a mutable builder for constructing an instance of ModerationResult.
The following fields are required:
.categories() .categoryAppliedInputTypes() .categoryScores() .flagged() .model()
-
-
-
-