Class: ModerationAPI::Models::Queue::ItemListResponse::Item

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/moderation_api/models/queue/item_list_response.rb

Defined Under Namespace

Modules: Status Classes: Action, Label

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(flagged:, label:, score:) ⇒ Object

Parameters:

  • flagged (Boolean)

    Whether this label caused a flag

  • label (String)

    Label name

  • score (Float)

    Confidence score of the label



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 23

class Item < ModerationAPI::Internal::Type::BaseModel
  # @!attribute id
  #   Content ID
  #
  #   @return [String]
  required :id, String

  # @!attribute content
  #   The content to be moderated
  #
  #   @return [String]
  required :content, String

  # @!attribute flagged
  #   Whether the item is flagged by any label
  #
  #   @return [Boolean]
  required :flagged, ModerationAPI::Internal::Type::Boolean

  # @!attribute labels
  #
  #   @return [Array<ModerationAPI::Models::Queue::ItemListResponse::Item::Label>]
  required :labels,
           -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::Queue::ItemListResponse::Item::Label] }

  # @!attribute status
  #   Status of the item
  #
  #   @return [Symbol, ModerationAPI::Models::Queue::ItemListResponse::Item::Status]
  required :status, enum: -> { ModerationAPI::Models::Queue::ItemListResponse::Item::Status }

  # @!attribute timestamp
  #   Unix timestamp of when the item was created
  #
  #   @return [Float]
  required :timestamp, Float

  # @!attribute actions
  #   Action IDs taken on this item
  #
  #   @return [Array<ModerationAPI::Models::Queue::ItemListResponse::Item::Action>, nil]
  optional :actions,
           -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::Queue::ItemListResponse::Item::Action] }

  # @!attribute author_id
  #   Author ID
  #
  #   @return [String, nil]
  optional :author_id, String, api_name: :authorId

  # @!attribute content_type
  #   Type of the content object
  #
  #   @return [String, nil]
  optional :content_type, String, api_name: :contentType

  # @!attribute conversation_id
  #   Conversation ID
  #
  #   @return [String, nil]
  optional :conversation_id, String, api_name: :conversationId

  # @!attribute language
  #   Content language
  #
  #   @return [String, nil]
  optional :language, String

  # @!method initialize(id:, content:, flagged:, labels:, status:, timestamp:, actions: nil, author_id: nil, content_type: nil, conversation_id: nil, language: nil)
  #   @param id [String] Content ID
  #
  #   @param content [String] The content to be moderated
  #
  #   @param flagged [Boolean] Whether the item is flagged by any label
  #
  #   @param labels [Array<ModerationAPI::Models::Queue::ItemListResponse::Item::Label>]
  #
  #   @param status [Symbol, ModerationAPI::Models::Queue::ItemListResponse::Item::Status] Status of the item
  #
  #   @param timestamp [Float] Unix timestamp of when the item was created
  #
  #   @param actions [Array<ModerationAPI::Models::Queue::ItemListResponse::Item::Action>] Action IDs taken on this item
  #
  #   @param author_id [String] Author ID
  #
  #   @param content_type [String] Type of the content object
  #
  #   @param conversation_id [String] Conversation ID
  #
  #   @param language [String] Content language

  class Label < ModerationAPI::Internal::Type::BaseModel
    # @!attribute flagged
    #   Whether this label caused a flag
    #
    #   @return [Boolean]
    required :flagged, ModerationAPI::Internal::Type::Boolean

    # @!attribute label
    #   Label name
    #
    #   @return [String]
    required :label, String

    # @!attribute score
    #   Confidence score of the label
    #
    #   @return [Float]
    required :score, Float

    # @!method initialize(flagged:, label:, score:)
    #   @param flagged [Boolean] Whether this label caused a flag
    #
    #   @param label [String] Label name
    #
    #   @param score [Float] Confidence score of the label
  end

  # Status of the item
  #
  # @see ModerationAPI::Models::Queue::ItemListResponse::Item#status
  module Status
    extend ModerationAPI::Internal::Type::Enum

    PENDING = :pending
    RESOLVED = :resolved

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  class Action < ModerationAPI::Internal::Type::BaseModel
    # @!attribute id
    #   Action ID
    #
    #   @return [String]
    required :id, String

    # @!attribute name
    #   Action name
    #
    #   @return [String]
    required :name, String

    # @!attribute timestamp
    #   Unix timestamp of when the action was taken
    #
    #   @return [Float]
    required :timestamp, Float

    # @!attribute comment
    #   Action comment
    #
    #   @return [String, nil]
    optional :comment, String

    # @!attribute reviewer
    #   Moderator userID
    #
    #   @return [String, nil]
    optional :reviewer, String

    # @!method initialize(id:, name:, timestamp:, comment: nil, reviewer: nil)
    #   @param id [String] Action ID
    #
    #   @param name [String] Action name
    #
    #   @param timestamp [Float] Unix timestamp of when the action was taken
    #
    #   @param comment [String] Action comment
    #
    #   @param reviewer [String] Moderator userID
  end
end

Instance Attribute Details

#actionsArray<ModerationAPI::Models::Queue::ItemListResponse::Item::Action>?

Action IDs taken on this item



64
65
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 64

optional :actions,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::Queue::ItemListResponse::Item::Action] }

#author_idString?

Author ID

Returns:

  • (String, nil)


71
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 71

optional :author_id, String, api_name: :authorId

#contentString

The content to be moderated

Returns:

  • (String)


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

required :content, String

#content_typeString?

Type of the content object

Returns:

  • (String, nil)


77
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 77

optional :content_type, String, api_name: :contentType

#conversation_idString?

Conversation ID

Returns:

  • (String, nil)


83
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 83

optional :conversation_id, String, api_name: :conversationId

#flaggedBoolean

Whether the item is flagged by any label

Returns:

  • (Boolean)


40
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 40

required :flagged, ModerationAPI::Internal::Type::Boolean

#idString

Content ID

Returns:

  • (String)


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

required :id, String

#labelsArray<ModerationAPI::Models::Queue::ItemListResponse::Item::Label>



45
46
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 45

required :labels,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::Queue::ItemListResponse::Item::Label] }

#languageString?

Content language

Returns:

  • (String, nil)


89
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 89

optional :language, String

#statusSymbol, ModerationAPI::Models::Queue::ItemListResponse::Item::Status

Status of the item



52
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 52

required :status, enum: -> { ModerationAPI::Models::Queue::ItemListResponse::Item::Status }

#timestampFloat

Unix timestamp of when the item was created

Returns:

  • (Float)


58
# File 'lib/moderation_api/models/queue/item_list_response.rb', line 58

required :timestamp, Float

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/moderation_api/models/queue/item_list_response.rb', line 150