Class: ModerationAPI::Models::AuthorListResponse::Author

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

Defined Under Namespace

Modules: Status Classes: Block, Metadata, Metrics, RiskEvaluation, TrustLevel

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(risk_level: nil) ⇒ Object

Risk assessment details, if available.

Parameters:

  • risk_level (Float, nil) (defaults to: nil)

    Calculated risk level based on more than 10 behavioral signals.



22
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/moderation_api/models/author_list_response.rb', line 22

class Author < ModerationAPI::Internal::Type::BaseModel
  # @!attribute id
  #   Author ID in Moderation API
  #
  #   @return [String]
  required :id, String

  # @!attribute block
  #   Block or suspension details, if applicable. Null if the author is enabled.
  #
  #   @return [ModerationAPI::Models::AuthorListResponse::Author::Block, nil]
  required :block, -> { ModerationAPI::Models::AuthorListResponse::Author::Block }, nil?: true

  # @!attribute first_seen
  #   Timestamp when author first appeared
  #
  #   @return [Float]
  required :first_seen, Float

  # @!attribute last_seen
  #   Timestamp of last activity
  #
  #   @return [Float]
  required :last_seen, Float

  # @!attribute metadata
  #   Additional metadata provided by your system. We recommend including any relevant
  #   information that may assist in the moderation process.
  #
  #   @return [ModerationAPI::Models::AuthorListResponse::Author::Metadata]
  required :metadata, -> { ModerationAPI::Models::AuthorListResponse::Author::Metadata }

  # @!attribute metrics
  #
  #   @return [ModerationAPI::Models::AuthorListResponse::Author::Metrics]
  required :metrics, -> { ModerationAPI::Models::AuthorListResponse::Author::Metrics }

  # @!attribute risk_evaluation
  #   Risk assessment details, if available.
  #
  #   @return [ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation, nil]
  required :risk_evaluation,
           -> { ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation },
           nil?: true

  # @!attribute status
  #   Current author status
  #
  #   @return [Symbol, ModerationAPI::Models::AuthorListResponse::Author::Status]
  required :status, enum: -> { ModerationAPI::Models::AuthorListResponse::Author::Status }

  # @!attribute trust_level
  #
  #   @return [ModerationAPI::Models::AuthorListResponse::Author::TrustLevel]
  required :trust_level, -> { ModerationAPI::Models::AuthorListResponse::Author::TrustLevel }

  # @!attribute email
  #   Author email address
  #
  #   @return [String, nil]
  optional :email, String, nil?: true

  # @!attribute external_id
  #   The author's ID from your system
  #
  #   @return [String, nil]
  optional :external_id, String, nil?: true

  # @!attribute external_link
  #   URL of the author's external profile
  #
  #   @return [String, nil]
  optional :external_link, String, nil?: true

  # @!attribute last_incident
  #   Timestamp of last incident
  #
  #   @return [Float, nil]
  optional :last_incident, Float, nil?: true

  # @!attribute name
  #   Author name or identifier
  #
  #   @return [String, nil]
  optional :name, String, nil?: true

  # @!attribute profile_picture
  #   URL of the author's profile picture
  #
  #   @return [String, nil]
  optional :profile_picture, String, nil?: true

  # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
  #   Some parameter documentations has been truncated, see
  #   {ModerationAPI::Models::AuthorListResponse::Author} for more details.
  #
  #   @param id [String] Author ID in Moderation API
  #
  #   @param block [ModerationAPI::Models::AuthorListResponse::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled.
  #
  #   @param first_seen [Float] Timestamp when author first appeared
  #
  #   @param last_seen [Float] Timestamp of last activity
  #
  #   @param metadata [ModerationAPI::Models::AuthorListResponse::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant
  #
  #   @param metrics [ModerationAPI::Models::AuthorListResponse::Author::Metrics]
  #
  #   @param risk_evaluation [ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation, nil] Risk assessment details, if available.
  #
  #   @param status [Symbol, ModerationAPI::Models::AuthorListResponse::Author::Status] Current author status
  #
  #   @param trust_level [ModerationAPI::Models::AuthorListResponse::Author::TrustLevel]
  #
  #   @param email [String, nil] Author email address
  #
  #   @param external_id [String, nil] The author's ID from your system
  #
  #   @param external_link [String, nil] URL of the author's external profile
  #
  #   @param last_incident [Float, nil] Timestamp of last incident
  #
  #   @param name [String, nil] Author name or identifier
  #
  #   @param profile_picture [String, nil] URL of the author's profile picture

  # @see ModerationAPI::Models::AuthorListResponse::Author#block
  class Block < ModerationAPI::Internal::Type::BaseModel
    # @!attribute reason
    #   The moderators reason why the author was blocked or suspended.
    #
    #   @return [String, nil]
    optional :reason, String, nil?: true

    # @!attribute until_
    #   The timestamp until which they are blocked if the author is suspended.
    #
    #   @return [Float, nil]
    optional :until_, Float, api_name: :until, nil?: true

    # @!method initialize(reason: nil, until_: nil)
    #   Block or suspension details, if applicable. Null if the author is enabled.
    #
    #   @param reason [String, nil] The moderators reason why the author was blocked or suspended.
    #
    #   @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended.
  end

  # @see ModerationAPI::Models::AuthorListResponse::Author#metadata
  class Metadata < ModerationAPI::Internal::Type::BaseModel
    # @!attribute email_verified
    #   Whether the author's email is verified
    #
    #   @return [Boolean, nil]
    optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true

    # @!attribute identity_verified
    #   Whether the author's identity is verified
    #
    #   @return [Boolean, nil]
    optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true

    # @!attribute is_paying_customer
    #   Whether the author is a paying customer
    #
    #   @return [Boolean, nil]
    optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true

    # @!attribute phone_verified
    #   Whether the author's phone number is verified
    #
    #   @return [Boolean, nil]
    optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true

    # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil)
    #   Additional metadata provided by your system. We recommend including any relevant
    #   information that may assist in the moderation process.
    #
    #   @param email_verified [Boolean, nil] Whether the author's email is verified
    #
    #   @param identity_verified [Boolean, nil] Whether the author's identity is verified
    #
    #   @param is_paying_customer [Boolean, nil] Whether the author is a paying customer
    #
    #   @param phone_verified [Boolean, nil] Whether the author's phone number is verified
  end

  # @see ModerationAPI::Models::AuthorListResponse::Author#metrics
  class Metrics < ModerationAPI::Internal::Type::BaseModel
    # @!attribute flagged_content
    #   Number of flagged content pieces
    #
    #   @return [Float]
    required :flagged_content, Float

    # @!attribute total_content
    #   Total pieces of content
    #
    #   @return [Float]
    required :total_content, Float

    # @!attribute average_sentiment
    #   Average sentiment score of content (-1 to 1). Requires a sentiment model in your
    #   project.
    #
    #   @return [Float, nil]
    optional :average_sentiment, Float, nil?: true

    # @!method initialize(flagged_content:, total_content:, average_sentiment: nil)
    #   Some parameter documentations has been truncated, see
    #   {ModerationAPI::Models::AuthorListResponse::Author::Metrics} for more details.
    #
    #   @param flagged_content [Float] Number of flagged content pieces
    #
    #   @param total_content [Float] Total pieces of content
    #
    #   @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your
  end

  # @see ModerationAPI::Models::AuthorListResponse::Author#risk_evaluation
  class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel
    # @!attribute risk_level
    #   Calculated risk level based on more than 10 behavioral signals.
    #
    #   @return [Float, nil]
    optional :risk_level, Float, nil?: true

    # @!method initialize(risk_level: nil)
    #   Risk assessment details, if available.
    #
    #   @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals.
  end

  # Current author status
  #
  # @see ModerationAPI::Models::AuthorListResponse::Author#status
  module Status
    extend ModerationAPI::Internal::Type::Enum

    ENABLED = :enabled
    SUSPENDED = :suspended
    BLOCKED = :blocked

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

  # @see ModerationAPI::Models::AuthorListResponse::Author#trust_level
  class TrustLevel < ModerationAPI::Internal::Type::BaseModel
    # @!attribute level
    #   Author trust level (-1, 0, 1, 2, 3, or 4)
    #
    #   @return [Float]
    required :level, Float

    # @!attribute manual
    #   True if the trust level was set manually by a moderator
    #
    #   @return [Boolean]
    required :manual, ModerationAPI::Internal::Type::Boolean

    # @!method initialize(level:, manual:)
    #   @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4)
    #
    #   @param manual [Boolean] True if the trust level was set manually by a moderator
  end
end

Instance Attribute Details

#blockModerationAPI::Models::AuthorListResponse::Author::Block?

Block or suspension details, if applicable. Null if the author is enabled.



33
# File 'lib/moderation_api/models/author_list_response.rb', line 33

required :block, -> { ModerationAPI::Models::AuthorListResponse::Author::Block }, nil?: true

#emailString?

Author email address

Returns:

  • (String, nil)


82
# File 'lib/moderation_api/models/author_list_response.rb', line 82

optional :email, String, nil?: true

#external_idString?

The author’s ID from your system

Returns:

  • (String, nil)


88
# File 'lib/moderation_api/models/author_list_response.rb', line 88

optional :external_id, String, nil?: true

URL of the author’s external profile

Returns:

  • (String, nil)


94
# File 'lib/moderation_api/models/author_list_response.rb', line 94

optional :external_link, String, nil?: true

#first_seenFloat

Timestamp when author first appeared

Returns:

  • (Float)


39
# File 'lib/moderation_api/models/author_list_response.rb', line 39

required :first_seen, Float

#idString

Author ID in Moderation API

Returns:

  • (String)


27
# File 'lib/moderation_api/models/author_list_response.rb', line 27

required :id, String

#last_incidentFloat?

Timestamp of last incident

Returns:

  • (Float, nil)


100
# File 'lib/moderation_api/models/author_list_response.rb', line 100

optional :last_incident, Float, nil?: true

#last_seenFloat

Timestamp of last activity

Returns:

  • (Float)


45
# File 'lib/moderation_api/models/author_list_response.rb', line 45

required :last_seen, Float

#metadataModerationAPI::Models::AuthorListResponse::Author::Metadata

Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process.



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

required :metadata, -> { ModerationAPI::Models::AuthorListResponse::Author::Metadata }

#metricsModerationAPI::Models::AuthorListResponse::Author::Metrics



57
# File 'lib/moderation_api/models/author_list_response.rb', line 57

required :metrics, -> { ModerationAPI::Models::AuthorListResponse::Author::Metrics }

#nameString?

Author name or identifier

Returns:

  • (String, nil)


106
# File 'lib/moderation_api/models/author_list_response.rb', line 106

optional :name, String, nil?: true

#profile_pictureString?

URL of the author’s profile picture

Returns:

  • (String, nil)


112
# File 'lib/moderation_api/models/author_list_response.rb', line 112

optional :profile_picture, String, nil?: true

#risk_evaluationModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation?

Risk assessment details, if available.



63
64
65
# File 'lib/moderation_api/models/author_list_response.rb', line 63

required :risk_evaluation,
-> { ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation },
nil?: true

#statusSymbol, ModerationAPI::Models::AuthorListResponse::Author::Status

Current author status



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

required :status, enum: -> { ModerationAPI::Models::AuthorListResponse::Author::Status }

#trust_levelModerationAPI::Models::AuthorListResponse::Author::TrustLevel



76
# File 'lib/moderation_api/models/author_list_response.rb', line 76

required :trust_level, -> { ModerationAPI::Models::AuthorListResponse::Author::TrustLevel }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/moderation_api/models/author_list_response.rb', line 265