Class: ModerationAPI::Models::ContentSubmitResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/moderation_api/models/content_submit_response.rb,
sig/moderation_api/models/content_submit_response.rbs

Overview

See Also:

  • ModerationAPI::Resources::Content#submit

Defined Under Namespace

Modules: Insight, Policy Classes: Author, Casebook, Content, Error, Evaluation, Meta, Recommendation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(key:, name:) ⇒ Object

Parameters:

  • key (String)
  • name (String)


# File 'lib/moderation_api/models/content_submit_response.rb', line 69

Instance Attribute Details

#authorModerationAPI::Models::ContentSubmitResponse::Author?

The author of the content if your account has authors enabled. Requires you to send authorId when submitting content.



12
# File 'lib/moderation_api/models/content_submit_response.rb', line 12

required :author, -> { ModerationAPI::Models::ContentSubmitResponse::Author }, nil?: true

#casebookModerationAPI::Models::ContentSubmitResponse::Casebook?

What your casebook — the record of your past moderation decisions — found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in recommendation, where a higher-priority rule may have settled the item first.



22
# File 'lib/moderation_api/models/content_submit_response.rb', line 22

required :casebook, -> { ModerationAPI::Models::ContentSubmitResponse::Casebook }, nil?: true

#contentModerationAPI::Models::ContentSubmitResponse::Content

Potentially modified content.



28
# File 'lib/moderation_api/models/content_submit_response.rb', line 28

required :content, -> { ModerationAPI::Models::ContentSubmitResponse::Content }

#errorsArray<ModerationAPI::Models::ContentSubmitResponse::Error>?

Policies that had errors



66
67
# File 'lib/moderation_api/models/content_submit_response.rb', line 66

optional :errors,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Error] }

#evaluationModerationAPI::Models::ContentSubmitResponse::Evaluation

The evaluation of the content after running the channel policies.



34
# File 'lib/moderation_api/models/content_submit_response.rb', line 34

required :evaluation, -> { ModerationAPI::Models::ContentSubmitResponse::Evaluation }

#insightsArray<ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight, ModerationAPI::Models::ContentSubmitResponse::Insight::LanguageInsight>

Results of all insights enabled in the channel.

Parameters:

  • value (::Array[ModerationAPI::Models::ContentSubmitResponse::insight])

Returns:



40
41
# File 'lib/moderation_api/models/content_submit_response.rb', line 40

required :insights,
-> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::Models::ContentSubmitResponse::Insight] }

#metaModerationAPI::Models::ContentSubmitResponse::Meta

Metadata about the moderation request



47
# File 'lib/moderation_api/models/content_submit_response.rb', line 47

required :meta, -> { ModerationAPI::Models::ContentSubmitResponse::Meta }

#policiesArray<ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput, ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput>

Results of all policies in the channel. Sorted by highest probability.

Parameters:

  • value (::Array[ModerationAPI::Models::ContentSubmitResponse::policy])

Returns:



53
54
# File 'lib/moderation_api/models/content_submit_response.rb', line 53

required :policies,
-> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::Models::ContentSubmitResponse::Policy] }

#recommendationModerationAPI::Models::ContentSubmitResponse::Recommendation

The recommendation for the content based on the evaluation.



60
# File 'lib/moderation_api/models/content_submit_response.rb', line 60

required :recommendation, -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/moderation_api/models/content_submit_response.rb', line 291

Instance Method Details

#to_hash{

Returns:

  • ({)


51
# File 'sig/moderation_api/models/content_submit_response.rbs', line 51

def to_hash: -> {