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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de1a136db4d8241134cdfbc409a0509c4d01e2955619249fad875c38ceb7cd4c
|
|
4
|
+
data.tar.gz: f7e22c1f1f5554878cfd83abac7f51f5468665989fd9c81846d6207462956b0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eca1219b263c3afb4a025016f0abdcd39380c75caa6b268842dc7d1ffc255d9bb66eacc012c025a1bbaa9590f4e4d69f821462f9b9c9757602d97e9fac2cee16
|
|
7
|
+
data.tar.gz: 776dc5e69582118a7600eef868cfbd699d80f5be3e35443e2e850dd53e17baf8bb12cc44154e09366fc603d394e4dee3d825829c37159fbe04def22487636f59
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.16.0 (2026-05-08)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.15.0...v2.16.0](https://github.com/moderation-api/sdk-ruby/compare/v2.15.0...v2.16.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([b84cbe4](https://github.com/moderation-api/sdk-ruby/commit/b84cbe4d456abf5ede25c5754295f498daa8b3ac))
|
|
10
|
+
* **api:** manual updates ([0293cc9](https://github.com/moderation-api/sdk-ruby/commit/0293cc979a8cae07a2b6a8fc12c34d882ce0337a))
|
|
11
|
+
|
|
3
12
|
## 2.15.0 (2026-05-06)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v2.14.0...v2.15.0](https://github.com/moderation-api/sdk-ruby/compare/v2.14.0...v2.15.0)
|
data/README.md
CHANGED
|
@@ -4,6 +4,31 @@ module ModerationAPI
|
|
|
4
4
|
module Internal
|
|
5
5
|
module Type
|
|
6
6
|
# @api private
|
|
7
|
+
#
|
|
8
|
+
# @example
|
|
9
|
+
# # `webhook_event` is a `ModerationAPI::WebhookEvent`
|
|
10
|
+
# case webhook_event
|
|
11
|
+
# when ModerationAPI::WebhookEvent::AuthorBlocked
|
|
12
|
+
# puts(webhook_event.id)
|
|
13
|
+
# when ModerationAPI::WebhookEvent::AuthorUnblocked
|
|
14
|
+
# puts(webhook_event.api_version)
|
|
15
|
+
# when ModerationAPI::WebhookEvent::AuthorSuspended
|
|
16
|
+
# puts(webhook_event.created)
|
|
17
|
+
# else
|
|
18
|
+
# puts(webhook_event)
|
|
19
|
+
# end
|
|
20
|
+
#
|
|
21
|
+
# @example
|
|
22
|
+
# case webhook_event
|
|
23
|
+
# in {type: :"author.blocked", id: id, api_version: api_version, created: created}
|
|
24
|
+
# puts(id)
|
|
25
|
+
# in {type: :"author.unblocked", id: id, api_version: api_version, created: created}
|
|
26
|
+
# puts(api_version)
|
|
27
|
+
# in {type: :"author.suspended", id: id, api_version: api_version, created: created}
|
|
28
|
+
# puts(created)
|
|
29
|
+
# else
|
|
30
|
+
# puts(webhook_event)
|
|
31
|
+
# end
|
|
7
32
|
module Union
|
|
8
33
|
include ModerationAPI::Internal::Type::Converter
|
|
9
34
|
include ModerationAPI::Internal::Util::SorbetRuntimeSupport
|
|
@@ -85,14 +85,7 @@ module ModerationAPI
|
|
|
85
85
|
# @return [Boolean, nil]
|
|
86
86
|
optional :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired
|
|
87
87
|
|
|
88
|
-
# @!
|
|
89
|
-
# The action's webhooks.
|
|
90
|
-
#
|
|
91
|
-
# @return [Array<ModerationAPI::Models::ActionCreateParams::Webhook>, nil]
|
|
92
|
-
optional :webhooks,
|
|
93
|
-
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::ActionCreateParams::Webhook] }
|
|
94
|
-
|
|
95
|
-
# @!method initialize(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, webhooks: nil, request_options: {})
|
|
88
|
+
# @!method initialize(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: {})
|
|
96
89
|
# Some parameter documentations has been truncated, see
|
|
97
90
|
# {ModerationAPI::Models::ActionCreateParams} for more details.
|
|
98
91
|
#
|
|
@@ -118,8 +111,6 @@ module ModerationAPI
|
|
|
118
111
|
#
|
|
119
112
|
# @param value_required [Boolean] Whether the action requires a value to be executed.
|
|
120
113
|
#
|
|
121
|
-
# @param webhooks [Array<ModerationAPI::Models::ActionCreateParams::Webhook>] The action's webhooks.
|
|
122
|
-
#
|
|
123
114
|
# @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
124
115
|
|
|
125
116
|
# Show the action in all queues, selected queues or no queues (to use via API
|
|
@@ -177,41 +168,6 @@ module ModerationAPI
|
|
|
177
168
|
# @!method self.values
|
|
178
169
|
# @return [Array<Symbol>]
|
|
179
170
|
end
|
|
180
|
-
|
|
181
|
-
class Webhook < ModerationAPI::Internal::Type::BaseModel
|
|
182
|
-
# @!attribute name
|
|
183
|
-
# The webhook's name, used to identify it in the dashboard
|
|
184
|
-
#
|
|
185
|
-
# @return [String]
|
|
186
|
-
required :name, String
|
|
187
|
-
|
|
188
|
-
# @!attribute url
|
|
189
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
190
|
-
#
|
|
191
|
-
# @return [String]
|
|
192
|
-
required :url, String
|
|
193
|
-
|
|
194
|
-
# @!attribute id
|
|
195
|
-
# ID of an existing webhook or undefined if this is a new webhook.
|
|
196
|
-
#
|
|
197
|
-
# @return [String, nil]
|
|
198
|
-
optional :id, String
|
|
199
|
-
|
|
200
|
-
# @!attribute description
|
|
201
|
-
# The webhook's description
|
|
202
|
-
#
|
|
203
|
-
# @return [String, nil]
|
|
204
|
-
optional :description, String, nil?: true
|
|
205
|
-
|
|
206
|
-
# @!method initialize(name:, url:, id: nil, description: nil)
|
|
207
|
-
# @param name [String] The webhook's name, used to identify it in the dashboard
|
|
208
|
-
#
|
|
209
|
-
# @param url [String] The webhook's URL. We'll call this URL when the event occurs.
|
|
210
|
-
#
|
|
211
|
-
# @param id [String] ID of an existing webhook or undefined if this is a new webhook.
|
|
212
|
-
#
|
|
213
|
-
# @param description [String, nil] The webhook's description
|
|
214
|
-
end
|
|
215
171
|
end
|
|
216
172
|
end
|
|
217
173
|
end
|
|
@@ -73,13 +73,6 @@ module ModerationAPI
|
|
|
73
73
|
# @return [Boolean]
|
|
74
74
|
required :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired
|
|
75
75
|
|
|
76
|
-
# @!attribute webhooks
|
|
77
|
-
# The action's webhooks.
|
|
78
|
-
#
|
|
79
|
-
# @return [Array<ModerationAPI::Models::ActionListResponseItem::Webhook>]
|
|
80
|
-
required :webhooks,
|
|
81
|
-
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionListResponseItem::Webhook] }
|
|
82
|
-
|
|
83
76
|
# @!attribute description
|
|
84
77
|
# The description of the action.
|
|
85
78
|
#
|
|
@@ -98,7 +91,7 @@ module ModerationAPI
|
|
|
98
91
|
# @return [Symbol, ModerationAPI::Models::ActionListResponseItem::Type, nil]
|
|
99
92
|
optional :type, enum: -> { ModerationAPI::Models::ActionListResponseItem::Type }, nil?: true
|
|
100
93
|
|
|
101
|
-
# @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:,
|
|
94
|
+
# @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, description: nil, key: nil, type: nil)
|
|
102
95
|
# Some parameter documentations has been truncated, see
|
|
103
96
|
# {ModerationAPI::Models::ActionListResponseItem} for more details.
|
|
104
97
|
#
|
|
@@ -122,8 +115,6 @@ module ModerationAPI
|
|
|
122
115
|
#
|
|
123
116
|
# @param value_required [Boolean] Whether the action requires a value to be executed.
|
|
124
117
|
#
|
|
125
|
-
# @param webhooks [Array<ModerationAPI::Models::ActionListResponseItem::Webhook>] The action's webhooks.
|
|
126
|
-
#
|
|
127
118
|
# @param description [String, nil] The description of the action.
|
|
128
119
|
#
|
|
129
120
|
# @param key [String, nil] User defined key of the action.
|
|
@@ -171,53 +162,6 @@ module ModerationAPI
|
|
|
171
162
|
# @return [Array<Symbol>]
|
|
172
163
|
end
|
|
173
164
|
|
|
174
|
-
class Webhook < ModerationAPI::Internal::Type::BaseModel
|
|
175
|
-
# @!attribute id
|
|
176
|
-
# The ID of the webhook.
|
|
177
|
-
#
|
|
178
|
-
# @return [String]
|
|
179
|
-
required :id, String
|
|
180
|
-
|
|
181
|
-
# @!attribute name
|
|
182
|
-
# The webhook's name, used to identify it in the dashboard
|
|
183
|
-
#
|
|
184
|
-
# @return [String]
|
|
185
|
-
required :name, String
|
|
186
|
-
|
|
187
|
-
# @!attribute url
|
|
188
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
189
|
-
#
|
|
190
|
-
# @return [String]
|
|
191
|
-
required :url, String
|
|
192
|
-
|
|
193
|
-
# @!attribute description
|
|
194
|
-
# The webhook's description
|
|
195
|
-
#
|
|
196
|
-
# @return [String, nil]
|
|
197
|
-
optional :description, String, nil?: true
|
|
198
|
-
|
|
199
|
-
# @!attribute moderation_action_id
|
|
200
|
-
# The ID of the moderation action to trigger the webhook on. Only used for
|
|
201
|
-
# moderation action webhooks.
|
|
202
|
-
#
|
|
203
|
-
# @return [String, nil]
|
|
204
|
-
optional :moderation_action_id, String, api_name: :moderationActionId, nil?: true
|
|
205
|
-
|
|
206
|
-
# @!method initialize(id:, name:, url:, description: nil, moderation_action_id: nil)
|
|
207
|
-
# Some parameter documentations has been truncated, see
|
|
208
|
-
# {ModerationAPI::Models::ActionListResponseItem::Webhook} for more details.
|
|
209
|
-
#
|
|
210
|
-
# @param id [String] The ID of the webhook.
|
|
211
|
-
#
|
|
212
|
-
# @param name [String] The webhook's name, used to identify it in the dashboard
|
|
213
|
-
#
|
|
214
|
-
# @param url [String] The webhook's URL. We'll call this URL when the event occurs.
|
|
215
|
-
#
|
|
216
|
-
# @param description [String, nil] The webhook's description
|
|
217
|
-
#
|
|
218
|
-
# @param moderation_action_id [String, nil] The ID of the moderation action to trigger the webhook on. Only used for moderat
|
|
219
|
-
end
|
|
220
|
-
|
|
221
165
|
# The type of the action.
|
|
222
166
|
#
|
|
223
167
|
# @see ModerationAPI::Models::ActionListResponseItem#type
|
|
@@ -74,13 +74,6 @@ module ModerationAPI
|
|
|
74
74
|
# @return [Boolean]
|
|
75
75
|
required :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired
|
|
76
76
|
|
|
77
|
-
# @!attribute webhooks
|
|
78
|
-
# The action's webhooks.
|
|
79
|
-
#
|
|
80
|
-
# @return [Array<ModerationAPI::Models::ActionRetrieveResponse::Webhook>]
|
|
81
|
-
required :webhooks,
|
|
82
|
-
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionRetrieveResponse::Webhook] }
|
|
83
|
-
|
|
84
77
|
# @!attribute description
|
|
85
78
|
# The description of the action.
|
|
86
79
|
#
|
|
@@ -99,7 +92,7 @@ module ModerationAPI
|
|
|
99
92
|
# @return [Symbol, ModerationAPI::Models::ActionRetrieveResponse::Type, nil]
|
|
100
93
|
optional :type, enum: -> { ModerationAPI::Models::ActionRetrieveResponse::Type }, nil?: true
|
|
101
94
|
|
|
102
|
-
# @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:,
|
|
95
|
+
# @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, description: nil, key: nil, type: nil)
|
|
103
96
|
# Some parameter documentations has been truncated, see
|
|
104
97
|
# {ModerationAPI::Models::ActionRetrieveResponse} for more details.
|
|
105
98
|
#
|
|
@@ -123,8 +116,6 @@ module ModerationAPI
|
|
|
123
116
|
#
|
|
124
117
|
# @param value_required [Boolean] Whether the action requires a value to be executed.
|
|
125
118
|
#
|
|
126
|
-
# @param webhooks [Array<ModerationAPI::Models::ActionRetrieveResponse::Webhook>] The action's webhooks.
|
|
127
|
-
#
|
|
128
119
|
# @param description [String, nil] The description of the action.
|
|
129
120
|
#
|
|
130
121
|
# @param key [String, nil] User defined key of the action.
|
|
@@ -172,53 +163,6 @@ module ModerationAPI
|
|
|
172
163
|
# @return [Array<Symbol>]
|
|
173
164
|
end
|
|
174
165
|
|
|
175
|
-
class Webhook < ModerationAPI::Internal::Type::BaseModel
|
|
176
|
-
# @!attribute id
|
|
177
|
-
# The ID of the webhook.
|
|
178
|
-
#
|
|
179
|
-
# @return [String]
|
|
180
|
-
required :id, String
|
|
181
|
-
|
|
182
|
-
# @!attribute name
|
|
183
|
-
# The webhook's name, used to identify it in the dashboard
|
|
184
|
-
#
|
|
185
|
-
# @return [String]
|
|
186
|
-
required :name, String
|
|
187
|
-
|
|
188
|
-
# @!attribute url
|
|
189
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
190
|
-
#
|
|
191
|
-
# @return [String]
|
|
192
|
-
required :url, String
|
|
193
|
-
|
|
194
|
-
# @!attribute description
|
|
195
|
-
# The webhook's description
|
|
196
|
-
#
|
|
197
|
-
# @return [String, nil]
|
|
198
|
-
optional :description, String, nil?: true
|
|
199
|
-
|
|
200
|
-
# @!attribute moderation_action_id
|
|
201
|
-
# The ID of the moderation action to trigger the webhook on. Only used for
|
|
202
|
-
# moderation action webhooks.
|
|
203
|
-
#
|
|
204
|
-
# @return [String, nil]
|
|
205
|
-
optional :moderation_action_id, String, api_name: :moderationActionId, nil?: true
|
|
206
|
-
|
|
207
|
-
# @!method initialize(id:, name:, url:, description: nil, moderation_action_id: nil)
|
|
208
|
-
# Some parameter documentations has been truncated, see
|
|
209
|
-
# {ModerationAPI::Models::ActionRetrieveResponse::Webhook} for more details.
|
|
210
|
-
#
|
|
211
|
-
# @param id [String] The ID of the webhook.
|
|
212
|
-
#
|
|
213
|
-
# @param name [String] The webhook's name, used to identify it in the dashboard
|
|
214
|
-
#
|
|
215
|
-
# @param url [String] The webhook's URL. We'll call this URL when the event occurs.
|
|
216
|
-
#
|
|
217
|
-
# @param description [String, nil] The webhook's description
|
|
218
|
-
#
|
|
219
|
-
# @param moderation_action_id [String, nil] The ID of the moderation action to trigger the webhook on. Only used for moderat
|
|
220
|
-
end
|
|
221
|
-
|
|
222
166
|
# The type of the action.
|
|
223
167
|
#
|
|
224
168
|
# @see ModerationAPI::Models::ActionRetrieveResponse#type
|
|
@@ -91,14 +91,7 @@ module ModerationAPI
|
|
|
91
91
|
# @return [Boolean, nil]
|
|
92
92
|
optional :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired
|
|
93
93
|
|
|
94
|
-
# @!
|
|
95
|
-
# The action's webhooks.
|
|
96
|
-
#
|
|
97
|
-
# @return [Array<ModerationAPI::Models::ActionUpdateParams::Webhook>, nil]
|
|
98
|
-
optional :webhooks,
|
|
99
|
-
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::ActionUpdateParams::Webhook] }
|
|
100
|
-
|
|
101
|
-
# @!method initialize(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, webhooks: nil, request_options: {})
|
|
94
|
+
# @!method initialize(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: {})
|
|
102
95
|
# Some parameter documentations has been truncated, see
|
|
103
96
|
# {ModerationAPI::Models::ActionUpdateParams} for more details.
|
|
104
97
|
#
|
|
@@ -126,8 +119,6 @@ module ModerationAPI
|
|
|
126
119
|
#
|
|
127
120
|
# @param value_required [Boolean] Whether the action requires a value to be executed.
|
|
128
121
|
#
|
|
129
|
-
# @param webhooks [Array<ModerationAPI::Models::ActionUpdateParams::Webhook>] The action's webhooks.
|
|
130
|
-
#
|
|
131
122
|
# @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
132
123
|
|
|
133
124
|
# Show the action in all queues, selected queues or no queues (to use via API
|
|
@@ -185,41 +176,6 @@ module ModerationAPI
|
|
|
185
176
|
# @!method self.values
|
|
186
177
|
# @return [Array<Symbol>]
|
|
187
178
|
end
|
|
188
|
-
|
|
189
|
-
class Webhook < ModerationAPI::Internal::Type::BaseModel
|
|
190
|
-
# @!attribute name
|
|
191
|
-
# The webhook's name, used to identify it in the dashboard
|
|
192
|
-
#
|
|
193
|
-
# @return [String]
|
|
194
|
-
required :name, String
|
|
195
|
-
|
|
196
|
-
# @!attribute url
|
|
197
|
-
# The webhook's URL. We'll call this URL when the event occurs.
|
|
198
|
-
#
|
|
199
|
-
# @return [String]
|
|
200
|
-
required :url, String
|
|
201
|
-
|
|
202
|
-
# @!attribute id
|
|
203
|
-
# ID of an existing webhook or undefined if this is a new webhook.
|
|
204
|
-
#
|
|
205
|
-
# @return [String, nil]
|
|
206
|
-
optional :id, String
|
|
207
|
-
|
|
208
|
-
# @!attribute description
|
|
209
|
-
# The webhook's description
|
|
210
|
-
#
|
|
211
|
-
# @return [String, nil]
|
|
212
|
-
optional :description, String, nil?: true
|
|
213
|
-
|
|
214
|
-
# @!method initialize(name:, url:, id: nil, description: nil)
|
|
215
|
-
# @param name [String] The webhook's name, used to identify it in the dashboard
|
|
216
|
-
#
|
|
217
|
-
# @param url [String] The webhook's URL. We'll call this URL when the event occurs.
|
|
218
|
-
#
|
|
219
|
-
# @param id [String] ID of an existing webhook or undefined if this is a new webhook.
|
|
220
|
-
#
|
|
221
|
-
# @param description [String, nil] The webhook's description
|
|
222
|
-
end
|
|
223
179
|
end
|
|
224
180
|
end
|
|
225
181
|
end
|