moderation_api 2.15.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/moderation_api/internal/type/union.rb +25 -0
- data/lib/moderation_api/models/action_create_params.rb +1 -45
- data/lib/moderation_api/models/action_list_response.rb +1 -57
- data/lib/moderation_api/models/action_retrieve_response.rb +1 -57
- data/lib/moderation_api/models/action_update_params.rb +1 -45
- data/lib/moderation_api/models/webhook_event.rb +6231 -0
- data/lib/moderation_api/models.rb +2 -0
- data/lib/moderation_api/resources/actions.rb +2 -6
- data/lib/moderation_api/version.rb +1 -1
- data/lib/moderation_api.rb +1 -0
- data/rbi/moderation_api/models/action_create_params.rbi +0 -80
- data/rbi/moderation_api/models/action_list_response.rbi +0 -85
- data/rbi/moderation_api/models/action_retrieve_response.rbi +0 -85
- data/rbi/moderation_api/models/action_update_params.rbi +0 -80
- data/rbi/moderation_api/models/webhook_event.rbi +11307 -0
- data/rbi/moderation_api/models.rbi +2 -0
- data/rbi/moderation_api/resources/actions.rbi +0 -8
- data/sig/moderation_api/models/action_create_params.rbs +1 -39
- data/sig/moderation_api/models/action_list_response.rbs +0 -42
- data/sig/moderation_api/models/action_retrieve_response.rbs +0 -42
- data/sig/moderation_api/models/action_update_params.rbs +1 -39
- data/sig/moderation_api/models/webhook_event.rbs +4746 -0
- data/sig/moderation_api/models.rbs +2 -0
- data/sig/moderation_api/resources/actions.rbs +0 -2
- metadata +5 -2
|
@@ -78,6 +78,8 @@ module ModerationAPI
|
|
|
78
78
|
|
|
79
79
|
QueueRetrieveParams = ModerationAPI::Models::QueueRetrieveParams
|
|
80
80
|
|
|
81
|
+
WebhookEvent = ModerationAPI::Models::WebhookEvent
|
|
82
|
+
|
|
81
83
|
Wordlist = ModerationAPI::Models::Wordlist
|
|
82
84
|
|
|
83
85
|
WordlistGetEmbeddingStatusParams = ModerationAPI::Models::WordlistGetEmbeddingStatusParams
|
|
@@ -11,7 +11,7 @@ module ModerationAPI
|
|
|
11
11
|
#
|
|
12
12
|
# Create an action.
|
|
13
13
|
#
|
|
14
|
-
# @overload create(name:, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil,
|
|
14
|
+
# @overload create(name:, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil, request_options: {})
|
|
15
15
|
#
|
|
16
16
|
# @param name [String] The name of the action.
|
|
17
17
|
#
|
|
@@ -35,8 +35,6 @@ module ModerationAPI
|
|
|
35
35
|
#
|
|
36
36
|
# @param value_required [Boolean] Whether the action requires a value to be executed.
|
|
37
37
|
#
|
|
38
|
-
# @param webhooks [Array<ModerationAPI::Models::ActionCreateParams::Webhook>] The action's webhooks.
|
|
39
|
-
#
|
|
40
38
|
# @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
41
39
|
#
|
|
42
40
|
# @return [ModerationAPI::Models::ActionCreateResponse]
|
|
@@ -78,7 +76,7 @@ module ModerationAPI
|
|
|
78
76
|
#
|
|
79
77
|
# Update an action.
|
|
80
78
|
#
|
|
81
|
-
# @overload update(id, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, name: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil,
|
|
79
|
+
# @overload update(id, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, name: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil, request_options: {})
|
|
82
80
|
#
|
|
83
81
|
# @param id [String] The ID of the action to update.
|
|
84
82
|
#
|
|
@@ -104,8 +102,6 @@ module ModerationAPI
|
|
|
104
102
|
#
|
|
105
103
|
# @param value_required [Boolean] Whether the action requires a value to be executed.
|
|
106
104
|
#
|
|
107
|
-
# @param webhooks [Array<ModerationAPI::Models::ActionUpdateParams::Webhook>] The action's webhooks.
|
|
108
|
-
#
|
|
109
105
|
# @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
110
106
|
#
|
|
111
107
|
# @return [ModerationAPI::Models::ActionUpdateResponse]
|
data/lib/moderation_api.rb
CHANGED
|
@@ -94,6 +94,7 @@ require_relative "moderation_api/models/queue_get_stats_params"
|
|
|
94
94
|
require_relative "moderation_api/models/queue_get_stats_response"
|
|
95
95
|
require_relative "moderation_api/models/queue_retrieve_params"
|
|
96
96
|
require_relative "moderation_api/models/queue_retrieve_response"
|
|
97
|
+
require_relative "moderation_api/models/webhook_event"
|
|
97
98
|
require_relative "moderation_api/models/wordlist/word_add_params"
|
|
98
99
|
require_relative "moderation_api/models/wordlist/word_add_response"
|
|
99
100
|
require_relative "moderation_api/models/wordlist/word_remove_params"
|
|
@@ -108,19 +108,6 @@ module ModerationAPI
|
|
|
108
108
|
sig { params(value_required: T::Boolean).void }
|
|
109
109
|
attr_writer :value_required
|
|
110
110
|
|
|
111
|
-
# The action's webhooks.
|
|
112
|
-
sig do
|
|
113
|
-
returns(T.nilable(T::Array[ModerationAPI::ActionCreateParams::Webhook]))
|
|
114
|
-
end
|
|
115
|
-
attr_reader :webhooks
|
|
116
|
-
|
|
117
|
-
sig do
|
|
118
|
-
params(
|
|
119
|
-
webhooks: T::Array[ModerationAPI::ActionCreateParams::Webhook::OrHash]
|
|
120
|
-
).void
|
|
121
|
-
end
|
|
122
|
-
attr_writer :webhooks
|
|
123
|
-
|
|
124
111
|
sig do
|
|
125
112
|
params(
|
|
126
113
|
name: String,
|
|
@@ -136,8 +123,6 @@ module ModerationAPI
|
|
|
136
123
|
ModerationAPI::ActionCreateParams::QueueBehaviour::OrSymbol,
|
|
137
124
|
type: T.nilable(ModerationAPI::ActionCreateParams::Type::OrSymbol),
|
|
138
125
|
value_required: T::Boolean,
|
|
139
|
-
webhooks:
|
|
140
|
-
T::Array[ModerationAPI::ActionCreateParams::Webhook::OrHash],
|
|
141
126
|
request_options: ModerationAPI::RequestOptions::OrHash
|
|
142
127
|
).returns(T.attached_class)
|
|
143
128
|
end
|
|
@@ -168,8 +153,6 @@ module ModerationAPI
|
|
|
168
153
|
type: nil,
|
|
169
154
|
# Whether the action requires a value to be executed.
|
|
170
155
|
value_required: nil,
|
|
171
|
-
# The action's webhooks.
|
|
172
|
-
webhooks: nil,
|
|
173
156
|
request_options: {}
|
|
174
157
|
)
|
|
175
158
|
end
|
|
@@ -190,7 +173,6 @@ module ModerationAPI
|
|
|
190
173
|
ModerationAPI::ActionCreateParams::QueueBehaviour::OrSymbol,
|
|
191
174
|
type: T.nilable(ModerationAPI::ActionCreateParams::Type::OrSymbol),
|
|
192
175
|
value_required: T::Boolean,
|
|
193
|
-
webhooks: T::Array[ModerationAPI::ActionCreateParams::Webhook],
|
|
194
176
|
request_options: ModerationAPI::RequestOptions
|
|
195
177
|
}
|
|
196
178
|
)
|
|
@@ -366,68 +348,6 @@ module ModerationAPI
|
|
|
366
348
|
def self.values
|
|
367
349
|
end
|
|
368
350
|
end
|
|
369
|
-
|
|
370
|
-
class Webhook < ModerationAPI::Internal::Type::BaseModel
|
|
371
|
-
OrHash =
|
|
372
|
-
T.type_alias do
|
|
373
|
-
T.any(
|
|
374
|
-
ModerationAPI::ActionCreateParams::Webhook,
|
|
375
|
-
ModerationAPI::Internal::AnyHash
|
|
376
|
-
)
|
|
377
|
-
end
|
|
378
|
-
|
|
379
|
-
# The webhook's name, used to identify it in the dashboard
|
|
380
|
-
sig { returns(String) }
|
|
381
|
-
attr_accessor :name
|
|
382
|
-
|
|
383
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
384
|
-
sig { returns(String) }
|
|
385
|
-
attr_accessor :url
|
|
386
|
-
|
|
387
|
-
# ID of an existing webhook or undefined if this is a new webhook.
|
|
388
|
-
sig { returns(T.nilable(String)) }
|
|
389
|
-
attr_reader :id
|
|
390
|
-
|
|
391
|
-
sig { params(id: String).void }
|
|
392
|
-
attr_writer :id
|
|
393
|
-
|
|
394
|
-
# The webhook's description
|
|
395
|
-
sig { returns(T.nilable(String)) }
|
|
396
|
-
attr_accessor :description
|
|
397
|
-
|
|
398
|
-
sig do
|
|
399
|
-
params(
|
|
400
|
-
name: String,
|
|
401
|
-
url: String,
|
|
402
|
-
id: String,
|
|
403
|
-
description: T.nilable(String)
|
|
404
|
-
).returns(T.attached_class)
|
|
405
|
-
end
|
|
406
|
-
def self.new(
|
|
407
|
-
# The webhook's name, used to identify it in the dashboard
|
|
408
|
-
name:,
|
|
409
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
410
|
-
url:,
|
|
411
|
-
# ID of an existing webhook or undefined if this is a new webhook.
|
|
412
|
-
id: nil,
|
|
413
|
-
# The webhook's description
|
|
414
|
-
description: nil
|
|
415
|
-
)
|
|
416
|
-
end
|
|
417
|
-
|
|
418
|
-
sig do
|
|
419
|
-
override.returns(
|
|
420
|
-
{
|
|
421
|
-
name: String,
|
|
422
|
-
url: String,
|
|
423
|
-
id: String,
|
|
424
|
-
description: T.nilable(String)
|
|
425
|
-
}
|
|
426
|
-
)
|
|
427
|
-
end
|
|
428
|
-
def to_hash
|
|
429
|
-
end
|
|
430
|
-
end
|
|
431
351
|
end
|
|
432
352
|
end
|
|
433
353
|
end
|
|
@@ -67,14 +67,6 @@ module ModerationAPI
|
|
|
67
67
|
sig { returns(T::Boolean) }
|
|
68
68
|
attr_accessor :value_required
|
|
69
69
|
|
|
70
|
-
# The action's webhooks.
|
|
71
|
-
sig do
|
|
72
|
-
returns(
|
|
73
|
-
T::Array[ModerationAPI::Models::ActionListResponseItem::Webhook]
|
|
74
|
-
)
|
|
75
|
-
end
|
|
76
|
-
attr_accessor :webhooks
|
|
77
|
-
|
|
78
70
|
# The description of the action.
|
|
79
71
|
sig { returns(T.nilable(String)) }
|
|
80
72
|
attr_accessor :description
|
|
@@ -110,10 +102,6 @@ module ModerationAPI
|
|
|
110
102
|
queue_behaviour:
|
|
111
103
|
ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::OrSymbol,
|
|
112
104
|
value_required: T::Boolean,
|
|
113
|
-
webhooks:
|
|
114
|
-
T::Array[
|
|
115
|
-
ModerationAPI::Models::ActionListResponseItem::Webhook::OrHash
|
|
116
|
-
],
|
|
117
105
|
description: T.nilable(String),
|
|
118
106
|
key: T.nilable(String),
|
|
119
107
|
type:
|
|
@@ -147,8 +135,6 @@ module ModerationAPI
|
|
|
147
135
|
queue_behaviour:,
|
|
148
136
|
# Whether the action requires a value to be executed.
|
|
149
137
|
value_required:,
|
|
150
|
-
# The action's webhooks.
|
|
151
|
-
webhooks:,
|
|
152
138
|
# The description of the action.
|
|
153
139
|
description: nil,
|
|
154
140
|
# User defined key of the action.
|
|
@@ -176,8 +162,6 @@ module ModerationAPI
|
|
|
176
162
|
queue_behaviour:
|
|
177
163
|
ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::TaggedSymbol,
|
|
178
164
|
value_required: T::Boolean,
|
|
179
|
-
webhooks:
|
|
180
|
-
T::Array[ModerationAPI::Models::ActionListResponseItem::Webhook],
|
|
181
165
|
description: T.nilable(String),
|
|
182
166
|
key: T.nilable(String),
|
|
183
167
|
type:
|
|
@@ -297,75 +281,6 @@ module ModerationAPI
|
|
|
297
281
|
end
|
|
298
282
|
end
|
|
299
283
|
|
|
300
|
-
class Webhook < ModerationAPI::Internal::Type::BaseModel
|
|
301
|
-
OrHash =
|
|
302
|
-
T.type_alias do
|
|
303
|
-
T.any(
|
|
304
|
-
ModerationAPI::Models::ActionListResponseItem::Webhook,
|
|
305
|
-
ModerationAPI::Internal::AnyHash
|
|
306
|
-
)
|
|
307
|
-
end
|
|
308
|
-
|
|
309
|
-
# The ID of the webhook.
|
|
310
|
-
sig { returns(String) }
|
|
311
|
-
attr_accessor :id
|
|
312
|
-
|
|
313
|
-
# The webhook's name, used to identify it in the dashboard
|
|
314
|
-
sig { returns(String) }
|
|
315
|
-
attr_accessor :name
|
|
316
|
-
|
|
317
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
318
|
-
sig { returns(String) }
|
|
319
|
-
attr_accessor :url
|
|
320
|
-
|
|
321
|
-
# The webhook's description
|
|
322
|
-
sig { returns(T.nilable(String)) }
|
|
323
|
-
attr_accessor :description
|
|
324
|
-
|
|
325
|
-
# The ID of the moderation action to trigger the webhook on. Only used for
|
|
326
|
-
# moderation action webhooks.
|
|
327
|
-
sig { returns(T.nilable(String)) }
|
|
328
|
-
attr_accessor :moderation_action_id
|
|
329
|
-
|
|
330
|
-
sig do
|
|
331
|
-
params(
|
|
332
|
-
id: String,
|
|
333
|
-
name: String,
|
|
334
|
-
url: String,
|
|
335
|
-
description: T.nilable(String),
|
|
336
|
-
moderation_action_id: T.nilable(String)
|
|
337
|
-
).returns(T.attached_class)
|
|
338
|
-
end
|
|
339
|
-
def self.new(
|
|
340
|
-
# The ID of the webhook.
|
|
341
|
-
id:,
|
|
342
|
-
# The webhook's name, used to identify it in the dashboard
|
|
343
|
-
name:,
|
|
344
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
345
|
-
url:,
|
|
346
|
-
# The webhook's description
|
|
347
|
-
description: nil,
|
|
348
|
-
# The ID of the moderation action to trigger the webhook on. Only used for
|
|
349
|
-
# moderation action webhooks.
|
|
350
|
-
moderation_action_id: nil
|
|
351
|
-
)
|
|
352
|
-
end
|
|
353
|
-
|
|
354
|
-
sig do
|
|
355
|
-
override.returns(
|
|
356
|
-
{
|
|
357
|
-
id: String,
|
|
358
|
-
name: String,
|
|
359
|
-
url: String,
|
|
360
|
-
description: T.nilable(String),
|
|
361
|
-
moderation_action_id: T.nilable(String)
|
|
362
|
-
}
|
|
363
|
-
)
|
|
364
|
-
end
|
|
365
|
-
def to_hash
|
|
366
|
-
end
|
|
367
|
-
end
|
|
368
|
-
|
|
369
284
|
# The type of the action.
|
|
370
285
|
module Type
|
|
371
286
|
extend ModerationAPI::Internal::Type::Enum
|
|
@@ -67,14 +67,6 @@ module ModerationAPI
|
|
|
67
67
|
sig { returns(T::Boolean) }
|
|
68
68
|
attr_accessor :value_required
|
|
69
69
|
|
|
70
|
-
# The action's webhooks.
|
|
71
|
-
sig do
|
|
72
|
-
returns(
|
|
73
|
-
T::Array[ModerationAPI::Models::ActionRetrieveResponse::Webhook]
|
|
74
|
-
)
|
|
75
|
-
end
|
|
76
|
-
attr_accessor :webhooks
|
|
77
|
-
|
|
78
70
|
# The description of the action.
|
|
79
71
|
sig { returns(T.nilable(String)) }
|
|
80
72
|
attr_accessor :description
|
|
@@ -110,10 +102,6 @@ module ModerationAPI
|
|
|
110
102
|
queue_behaviour:
|
|
111
103
|
ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::OrSymbol,
|
|
112
104
|
value_required: T::Boolean,
|
|
113
|
-
webhooks:
|
|
114
|
-
T::Array[
|
|
115
|
-
ModerationAPI::Models::ActionRetrieveResponse::Webhook::OrHash
|
|
116
|
-
],
|
|
117
105
|
description: T.nilable(String),
|
|
118
106
|
key: T.nilable(String),
|
|
119
107
|
type:
|
|
@@ -147,8 +135,6 @@ module ModerationAPI
|
|
|
147
135
|
queue_behaviour:,
|
|
148
136
|
# Whether the action requires a value to be executed.
|
|
149
137
|
value_required:,
|
|
150
|
-
# The action's webhooks.
|
|
151
|
-
webhooks:,
|
|
152
138
|
# The description of the action.
|
|
153
139
|
description: nil,
|
|
154
140
|
# User defined key of the action.
|
|
@@ -176,8 +162,6 @@ module ModerationAPI
|
|
|
176
162
|
queue_behaviour:
|
|
177
163
|
ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::TaggedSymbol,
|
|
178
164
|
value_required: T::Boolean,
|
|
179
|
-
webhooks:
|
|
180
|
-
T::Array[ModerationAPI::Models::ActionRetrieveResponse::Webhook],
|
|
181
165
|
description: T.nilable(String),
|
|
182
166
|
key: T.nilable(String),
|
|
183
167
|
type:
|
|
@@ -297,75 +281,6 @@ module ModerationAPI
|
|
|
297
281
|
end
|
|
298
282
|
end
|
|
299
283
|
|
|
300
|
-
class Webhook < ModerationAPI::Internal::Type::BaseModel
|
|
301
|
-
OrHash =
|
|
302
|
-
T.type_alias do
|
|
303
|
-
T.any(
|
|
304
|
-
ModerationAPI::Models::ActionRetrieveResponse::Webhook,
|
|
305
|
-
ModerationAPI::Internal::AnyHash
|
|
306
|
-
)
|
|
307
|
-
end
|
|
308
|
-
|
|
309
|
-
# The ID of the webhook.
|
|
310
|
-
sig { returns(String) }
|
|
311
|
-
attr_accessor :id
|
|
312
|
-
|
|
313
|
-
# The webhook's name, used to identify it in the dashboard
|
|
314
|
-
sig { returns(String) }
|
|
315
|
-
attr_accessor :name
|
|
316
|
-
|
|
317
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
318
|
-
sig { returns(String) }
|
|
319
|
-
attr_accessor :url
|
|
320
|
-
|
|
321
|
-
# The webhook's description
|
|
322
|
-
sig { returns(T.nilable(String)) }
|
|
323
|
-
attr_accessor :description
|
|
324
|
-
|
|
325
|
-
# The ID of the moderation action to trigger the webhook on. Only used for
|
|
326
|
-
# moderation action webhooks.
|
|
327
|
-
sig { returns(T.nilable(String)) }
|
|
328
|
-
attr_accessor :moderation_action_id
|
|
329
|
-
|
|
330
|
-
sig do
|
|
331
|
-
params(
|
|
332
|
-
id: String,
|
|
333
|
-
name: String,
|
|
334
|
-
url: String,
|
|
335
|
-
description: T.nilable(String),
|
|
336
|
-
moderation_action_id: T.nilable(String)
|
|
337
|
-
).returns(T.attached_class)
|
|
338
|
-
end
|
|
339
|
-
def self.new(
|
|
340
|
-
# The ID of the webhook.
|
|
341
|
-
id:,
|
|
342
|
-
# The webhook's name, used to identify it in the dashboard
|
|
343
|
-
name:,
|
|
344
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
345
|
-
url:,
|
|
346
|
-
# The webhook's description
|
|
347
|
-
description: nil,
|
|
348
|
-
# The ID of the moderation action to trigger the webhook on. Only used for
|
|
349
|
-
# moderation action webhooks.
|
|
350
|
-
moderation_action_id: nil
|
|
351
|
-
)
|
|
352
|
-
end
|
|
353
|
-
|
|
354
|
-
sig do
|
|
355
|
-
override.returns(
|
|
356
|
-
{
|
|
357
|
-
id: String,
|
|
358
|
-
name: String,
|
|
359
|
-
url: String,
|
|
360
|
-
description: T.nilable(String),
|
|
361
|
-
moderation_action_id: T.nilable(String)
|
|
362
|
-
}
|
|
363
|
-
)
|
|
364
|
-
end
|
|
365
|
-
def to_hash
|
|
366
|
-
end
|
|
367
|
-
end
|
|
368
|
-
|
|
369
284
|
# The type of the action.
|
|
370
285
|
module Type
|
|
371
286
|
extend ModerationAPI::Internal::Type::Enum
|
|
@@ -115,19 +115,6 @@ module ModerationAPI
|
|
|
115
115
|
sig { params(value_required: T::Boolean).void }
|
|
116
116
|
attr_writer :value_required
|
|
117
117
|
|
|
118
|
-
# The action's webhooks.
|
|
119
|
-
sig do
|
|
120
|
-
returns(T.nilable(T::Array[ModerationAPI::ActionUpdateParams::Webhook]))
|
|
121
|
-
end
|
|
122
|
-
attr_reader :webhooks
|
|
123
|
-
|
|
124
|
-
sig do
|
|
125
|
-
params(
|
|
126
|
-
webhooks: T::Array[ModerationAPI::ActionUpdateParams::Webhook::OrHash]
|
|
127
|
-
).void
|
|
128
|
-
end
|
|
129
|
-
attr_writer :webhooks
|
|
130
|
-
|
|
131
118
|
sig do
|
|
132
119
|
params(
|
|
133
120
|
id: String,
|
|
@@ -144,8 +131,6 @@ module ModerationAPI
|
|
|
144
131
|
ModerationAPI::ActionUpdateParams::QueueBehaviour::OrSymbol,
|
|
145
132
|
type: T.nilable(ModerationAPI::ActionUpdateParams::Type::OrSymbol),
|
|
146
133
|
value_required: T::Boolean,
|
|
147
|
-
webhooks:
|
|
148
|
-
T::Array[ModerationAPI::ActionUpdateParams::Webhook::OrHash],
|
|
149
134
|
request_options: ModerationAPI::RequestOptions::OrHash
|
|
150
135
|
).returns(T.attached_class)
|
|
151
136
|
end
|
|
@@ -178,8 +163,6 @@ module ModerationAPI
|
|
|
178
163
|
type: nil,
|
|
179
164
|
# Whether the action requires a value to be executed.
|
|
180
165
|
value_required: nil,
|
|
181
|
-
# The action's webhooks.
|
|
182
|
-
webhooks: nil,
|
|
183
166
|
request_options: {}
|
|
184
167
|
)
|
|
185
168
|
end
|
|
@@ -201,7 +184,6 @@ module ModerationAPI
|
|
|
201
184
|
ModerationAPI::ActionUpdateParams::QueueBehaviour::OrSymbol,
|
|
202
185
|
type: T.nilable(ModerationAPI::ActionUpdateParams::Type::OrSymbol),
|
|
203
186
|
value_required: T::Boolean,
|
|
204
|
-
webhooks: T::Array[ModerationAPI::ActionUpdateParams::Webhook],
|
|
205
187
|
request_options: ModerationAPI::RequestOptions
|
|
206
188
|
}
|
|
207
189
|
)
|
|
@@ -377,68 +359,6 @@ module ModerationAPI
|
|
|
377
359
|
def self.values
|
|
378
360
|
end
|
|
379
361
|
end
|
|
380
|
-
|
|
381
|
-
class Webhook < ModerationAPI::Internal::Type::BaseModel
|
|
382
|
-
OrHash =
|
|
383
|
-
T.type_alias do
|
|
384
|
-
T.any(
|
|
385
|
-
ModerationAPI::ActionUpdateParams::Webhook,
|
|
386
|
-
ModerationAPI::Internal::AnyHash
|
|
387
|
-
)
|
|
388
|
-
end
|
|
389
|
-
|
|
390
|
-
# The webhook's name, used to identify it in the dashboard
|
|
391
|
-
sig { returns(String) }
|
|
392
|
-
attr_accessor :name
|
|
393
|
-
|
|
394
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
395
|
-
sig { returns(String) }
|
|
396
|
-
attr_accessor :url
|
|
397
|
-
|
|
398
|
-
# ID of an existing webhook or undefined if this is a new webhook.
|
|
399
|
-
sig { returns(T.nilable(String)) }
|
|
400
|
-
attr_reader :id
|
|
401
|
-
|
|
402
|
-
sig { params(id: String).void }
|
|
403
|
-
attr_writer :id
|
|
404
|
-
|
|
405
|
-
# The webhook's description
|
|
406
|
-
sig { returns(T.nilable(String)) }
|
|
407
|
-
attr_accessor :description
|
|
408
|
-
|
|
409
|
-
sig do
|
|
410
|
-
params(
|
|
411
|
-
name: String,
|
|
412
|
-
url: String,
|
|
413
|
-
id: String,
|
|
414
|
-
description: T.nilable(String)
|
|
415
|
-
).returns(T.attached_class)
|
|
416
|
-
end
|
|
417
|
-
def self.new(
|
|
418
|
-
# The webhook's name, used to identify it in the dashboard
|
|
419
|
-
name:,
|
|
420
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
421
|
-
url:,
|
|
422
|
-
# ID of an existing webhook or undefined if this is a new webhook.
|
|
423
|
-
id: nil,
|
|
424
|
-
# The webhook's description
|
|
425
|
-
description: nil
|
|
426
|
-
)
|
|
427
|
-
end
|
|
428
|
-
|
|
429
|
-
sig do
|
|
430
|
-
override.returns(
|
|
431
|
-
{
|
|
432
|
-
name: String,
|
|
433
|
-
url: String,
|
|
434
|
-
id: String,
|
|
435
|
-
description: T.nilable(String)
|
|
436
|
-
}
|
|
437
|
-
)
|
|
438
|
-
end
|
|
439
|
-
def to_hash
|
|
440
|
-
end
|
|
441
|
-
end
|
|
442
362
|
end
|
|
443
363
|
end
|
|
444
364
|
end
|