moderation_api 3.3.0 → 3.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7c3df748ef6509887dbd63a6073f6e160f5dd566c88de8ab305efd5bd378e16
4
- data.tar.gz: f8c4706f7d26fc7eb6750e421ecff1a439df93d9632b7b685d8f77a4ff4a1fc5
3
+ metadata.gz: e39d2c55ad25a65f5fc75792b5bd45e942c0d39807ec6bb682fc470d5af3ff25
4
+ data.tar.gz: 34670fc686c198d679f3571e03bb565908bf606076da564ba497f496d3756135
5
5
  SHA512:
6
- metadata.gz: 7ef8d395756702eedea1bacabbf7d8ddc2c315ec7211a01d53a3d40ebe80a0cec868097304ef44247999b2740dc1ee05147ab5aff619fcd5ade39a2f646dae5f
7
- data.tar.gz: 9d3e9d581975996d32c9ea54136a9c3efc1237480f435c295b44d9b52c24be9e12271041e999f944ecc8874699a8c2ec2d4d62d8ddc1408794415c6e234c162c
6
+ metadata.gz: 3dc11e8e579b1732cf98afc8dd3c5c86dcdb5c06c5b55fa553b1b64fd67dad933cfc29b75ee10e209d3aeb5ef92ebda7922f8cc9b3849a08e5dac0c3ec8916d8
7
+ data.tar.gz: dec1cdad4cba663f177f2319236fdd29a163af069a7641508d4da47ef81211d95be50bf7738740025c97bf21c521f5362034a406c8a953a6afe94fecbf276bd0
@@ -48,7 +48,7 @@ module ModerationApi
48
48
  }
49
49
  def list(request:, timeout_ms: nil, http_headers: nil)
50
50
  # list - List queue items
51
- # List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item.
51
+ # List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` or `contentId` to resolve or unresolve an item.
52
52
  url, params = @sdk_configuration.get_server_details
53
53
  base_url = Utils.template_url(url, params)
54
54
  url = Utils.generate_url(
@@ -375,7 +375,7 @@ module ModerationApi
375
375
  }
376
376
  def resolve(id:, item_id:, project_id: nil, timeout_ms: nil, http_headers: nil)
377
377
  # resolve - Resolve a queue item
378
- # Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`.
378
+ # Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. `itemId` is the item `id` or your `contentId`. To also take a moderation action, use `POST /actions/execute`.
379
379
  request = Models::Operations::ResolveQueueItemRequest.new(
380
380
  id: id,
381
381
  item_id: item_id,
@@ -637,7 +637,7 @@ module ModerationApi
637
637
  }
638
638
  def resolve_many(body:, id:, project_id: nil, timeout_ms: nil, http_headers: nil)
639
639
  # resolve_many - Resolve queue items
640
- # Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`.
640
+ # Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`, and each ID is an item `id` or your `contentId`. IDs that match no item in the project are skipped and returned in `notFoundIds`.
641
641
  request = Models::Operations::ResolveQueueItemsRequest.new(
642
642
  id: id,
643
643
  body: body,
@@ -912,7 +912,7 @@ module ModerationApi
912
912
  }
913
913
  def unresolve(id:, item_id:, project_id: nil, timeout_ms: nil, http_headers: nil)
914
914
  # unresolve - Unresolve a queue item
915
- # Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list.
915
+ # Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. `itemId` is the item `id` or your `contentId`.
916
916
  request = Models::Operations::UnresolveQueueItemRequest.new(
917
917
  id: id,
918
918
  item_id: item_id,
@@ -11,9 +11,9 @@ module ModerationApi
11
11
  extend T::Sig
12
12
  include Crystalline::MetadataFields
13
13
 
14
- # The item ID. Use it to resolve or unresolve the item in this queue.
14
+ # The item ID: the ID of this submission. Use it, or `contentId`, to resolve or unresolve the item in this queue.
15
15
  field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}}
16
- # Your content ID, as you sent it to `POST /moderate`.
16
+ # Your content ID, as you sent it to `POST /moderate`. Webhooks send it as `item.id`. The resolve endpoints accept it in place of `id`.
17
17
  field(
18
18
  :content_id,
19
19
  ::String,
@@ -0,0 +1,39 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+ module ModerationApi
7
+ module Models
8
+ module Operations
9
+
10
+ class DeleteWordlistRequest
11
+ extend T::Sig
12
+ include Crystalline::MetadataFields
13
+
14
+ # ID of the wordlist to delete
15
+ field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}}
16
+ # The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.
17
+ field(
18
+ :project_id,
19
+ Crystalline::Nilable.new(::String),
20
+ {'header': {'field_name': "Project-Id", 'style': "simple", 'explode': false}}
21
+ )
22
+
23
+ sig { params(id: ::String, project_id: T.nilable(::String)).void }
24
+ def initialize(id:, project_id: nil)
25
+ @id = id
26
+ @project_id = project_id
27
+ end
28
+
29
+ sig { params(other: T.untyped).returns(T::Boolean) }
30
+ def ==(other)
31
+ return false unless other.is_a?(self.class)
32
+ return false unless @id == other.id
33
+ return false unless @project_id == other.project_id
34
+ true
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,20 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ class ModerationApi::Models::Operations::DeleteWordlistRequest
5
+ extend ::Crystalline::MetadataFields::ClassMethods
6
+ end
7
+
8
+ class ModerationApi::Models::Operations::DeleteWordlistRequest
9
+ def id
10
+ end
11
+
12
+ def id=(str_)
13
+ end
14
+
15
+ def project_id
16
+ end
17
+
18
+ def project_id=(str_)
19
+ end
20
+ end
@@ -0,0 +1,51 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+ module ModerationApi
7
+ module Models
8
+ module Operations
9
+
10
+ class DeleteWordlistResponse
11
+ extend T::Sig
12
+ include Crystalline::MetadataFields
13
+
14
+ # HTTP response content type for this operation
15
+ field :content_type, ::String
16
+ # HTTP response status code for this operation
17
+ field :status_code, ::Integer
18
+ # Raw HTTP response; suitable for custom response parsing
19
+ field :raw_response, ::Faraday::Response
20
+ # Wordlist deleted successfully
21
+ field :object, Crystalline::Nilable.new(Models::Operations::DeleteWordlistResponseBody)
22
+
23
+ sig {
24
+ params(
25
+ content_type: ::String,
26
+ status_code: ::Integer,
27
+ raw_response: ::Faraday::Response,
28
+ object: T.nilable(Models::Operations::DeleteWordlistResponseBody)
29
+ )
30
+ .void
31
+ }
32
+ def initialize(content_type:, status_code:, raw_response:, object: nil)
33
+ @content_type = content_type
34
+ @status_code = status_code
35
+ @raw_response = raw_response
36
+ @object = object
37
+ end
38
+
39
+ sig { params(other: T.untyped).returns(T::Boolean) }
40
+ def ==(other)
41
+ return false unless other.is_a?(self.class)
42
+ return false unless @content_type == other.content_type
43
+ return false unless @status_code == other.status_code
44
+ return false unless @raw_response == other.raw_response
45
+ return false unless @object == other.object
46
+ true
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,32 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ class ModerationApi::Models::Operations::DeleteWordlistResponse
5
+ extend ::Crystalline::MetadataFields::ClassMethods
6
+ end
7
+
8
+ class ModerationApi::Models::Operations::DeleteWordlistResponse
9
+ def content_type
10
+ end
11
+
12
+ def content_type=(str_)
13
+ end
14
+
15
+ def status_code
16
+ end
17
+
18
+ def status_code=(str_)
19
+ end
20
+
21
+ def raw_response
22
+ end
23
+
24
+ def raw_response=(str_)
25
+ end
26
+
27
+ def object
28
+ end
29
+
30
+ def object=(str_)
31
+ end
32
+ end
@@ -0,0 +1,47 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+ module ModerationApi
7
+ module Models
8
+ module Operations
9
+ # Wordlist deleted successfully
10
+ class DeleteWordlistResponseBody
11
+ extend T::Sig
12
+ include Crystalline::MetadataFields
13
+
14
+ # ID of the deleted wordlist
15
+ field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}}
16
+ # Whether the wordlist was deleted
17
+ field(
18
+ :deleted,
19
+ Crystalline::Boolean.new,
20
+ {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("deleted"), required: true}}
21
+ )
22
+ # IDs of the channels that used the wordlist. It was removed from them.
23
+ field(
24
+ :detached_channel_ids,
25
+ Crystalline::Array.new(::String),
26
+ {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("detachedChannelIds"), required: true}}
27
+ )
28
+
29
+ sig { params(id: ::String, deleted: T::Boolean, detached_channel_ids: T::Array[::String]).void }
30
+ def initialize(id:, deleted:, detached_channel_ids:)
31
+ @id = id
32
+ @deleted = deleted
33
+ @detached_channel_ids = detached_channel_ids
34
+ end
35
+
36
+ sig { params(other: T.untyped).returns(T::Boolean) }
37
+ def ==(other)
38
+ return false unless other.is_a?(self.class)
39
+ return false unless @id == other.id
40
+ return false unless @deleted == other.deleted
41
+ return false unless @detached_channel_ids == other.detached_channel_ids
42
+ true
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,26 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ class ModerationApi::Models::Operations::DeleteWordlistResponseBody
5
+ extend ::Crystalline::MetadataFields::ClassMethods
6
+ end
7
+
8
+ class ModerationApi::Models::Operations::DeleteWordlistResponseBody
9
+ def id
10
+ end
11
+
12
+ def id=(str_)
13
+ end
14
+
15
+ def deleted
16
+ end
17
+
18
+ def deleted=(str_)
19
+ end
20
+
21
+ def detached_channel_ids
22
+ end
23
+
24
+ def detached_channel_ids=(str_)
25
+ end
26
+ end
@@ -13,7 +13,7 @@ module ModerationApi
13
13
 
14
14
  # The queue ID.
15
15
  field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}}
16
- # The item ID to resolve.
16
+ # The item to resolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it.
17
17
  field :item_id, ::String, {'path_param': {'field_name': "itemId", 'style': "simple", 'explode': false}}
18
18
  # The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.
19
19
  field(
@@ -11,7 +11,7 @@ module ModerationApi
11
11
  extend T::Sig
12
12
  include Crystalline::MetadataFields
13
13
 
14
- # The item IDs to resolve. Up to 100.
14
+ # The items to resolve, up to 100. Each is the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it.
15
15
  field(
16
16
  :item_ids,
17
17
  Crystalline::Array.new(::String),
@@ -17,7 +17,7 @@ module ModerationApi
17
17
  ::Integer,
18
18
  {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("resolved"), required: true}}
19
19
  )
20
- # Item IDs that do not exist in the project.
20
+ # IDs from `itemIds` that match no item or content ID in the project.
21
21
  field(
22
22
  :not_found_ids,
23
23
  Crystalline::Array.new(::String),
@@ -24,7 +24,7 @@ module ModerationApi
24
24
  )
25
25
 
26
26
  field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}}
27
- # Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy.
27
+ # Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack, and hidden_lookalike and leetspeak default to off because they are opt-in. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. Lookalike words are only spelled out in the cleaned text when their signal is enabled.
28
28
  field(
29
29
  :signals,
30
30
  Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Operations::SignalsRequest)),
@@ -13,7 +13,7 @@ module ModerationApi
13
13
 
14
14
  # The queue ID.
15
15
  field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}}
16
- # The item ID to unresolve.
16
+ # The item to unresolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it.
17
17
  field :item_id, ::String, {'path_param': {'field_name': "itemId", 'style': "simple", 'explode': false}}
18
18
  # The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.
19
19
  field(
@@ -164,6 +164,9 @@ module ModerationApi
164
164
  autoload :DeleteWebhookResponseBody, "moderation_api/models/operations/deletewebhook_responsebody.rb"
165
165
  autoload :DeleteWebhookRequest, "moderation_api/models/operations/deletewebhook_request.rb"
166
166
  autoload :DeleteWebhookResponse, "moderation_api/models/operations/deletewebhook_response.rb"
167
+ autoload :DeleteWordlistResponseBody, "moderation_api/models/operations/deletewordlist_responsebody.rb"
168
+ autoload :DeleteWordlistRequest, "moderation_api/models/operations/deletewordlist_request.rb"
169
+ autoload :DeleteWordlistResponse, "moderation_api/models/operations/deletewordlist_response.rb"
167
170
  autoload :DuplicateChannelRequestBody, "moderation_api/models/operations/duplicatechannel_requestbody.rb"
168
171
  autoload :DuplicateChannelRequest, "moderation_api/models/operations/duplicatechannel_request.rb"
169
172
  autoload :DuplicateChannelResponse, "moderation_api/models/operations/duplicatechannel_response.rb"
@@ -59,7 +59,7 @@ module ModerationApi
59
59
  client: nil,
60
60
  retry_config: nil,
61
61
  timeout_ms: nil,
62
- secret_key: nil,
62
+ secret_key: ENV.fetch("MODAPI_SECRET_KEY", nil),
63
63
  security_source: nil,
64
64
  server_idx: nil,
65
65
  server_url: nil,
@@ -93,9 +93,9 @@ module ModerationApi
93
93
 
94
94
  @language = "ruby"
95
95
  @openapi_doc_version = "1.1.0"
96
- @sdk_version = "3.3.0"
96
+ @sdk_version = "3.4.0"
97
97
  @gen_version = "internal"
98
- @user_agent = "speakeasy-sdk/ruby 3.3.0 internal 1.1.0 moderation_api"
98
+ @user_agent = "speakeasy-sdk/ruby 3.4.0 internal 1.1.0 moderation_api"
99
99
  end
100
100
 
101
101
  sig { returns([String, T::Hash[Symbol, String]]) }
@@ -1120,6 +1120,222 @@ module ModerationApi
1120
1120
  end
1121
1121
  end
1122
1122
 
1123
+ sig {
1124
+ params(
1125
+ id: ::String,
1126
+ project_id: T.nilable(::String),
1127
+ timeout_ms: T.nilable(Integer),
1128
+ http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
1129
+ )
1130
+ .returns(Models::Operations::DeleteWordlistResponse)
1131
+ }
1132
+ def delete(id:, project_id: nil, timeout_ms: nil, http_headers: nil)
1133
+ # delete - Delete wordlist
1134
+ # Delete a wordlist and its words. Channels that use the wordlist do not block the delete: the wordlist is removed from their policies. `detachedChannelIds` lists those channels. This cannot be undone.
1135
+ request = Models::Operations::DeleteWordlistRequest.new(
1136
+ id: id,
1137
+ project_id: project_id
1138
+ )
1139
+ url, params = @sdk_configuration.get_server_details
1140
+ base_url = Utils.template_url(url, params)
1141
+ url = Utils.generate_url(
1142
+ Models::Operations::DeleteWordlistRequest,
1143
+ base_url,
1144
+ "/wordlist/{id}",
1145
+ request
1146
+ )
1147
+ headers = Utils.get_headers(request)
1148
+ headers = T.cast(headers, T::Hash[String, String])
1149
+ headers["Accept"] = "application/json"
1150
+ headers["user-agent"] = @sdk_configuration.user_agent
1151
+
1152
+ security = @sdk_configuration.security_source&.call
1153
+
1154
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
1155
+ timeout ||= @sdk_configuration.timeout
1156
+
1157
+ connection = @sdk_configuration.client
1158
+
1159
+ hook_ctx = SDKHooks::HookContext.new(
1160
+ config: @sdk_configuration,
1161
+ base_url: base_url,
1162
+ oauth2_scopes: nil,
1163
+ operation_id: "deleteWordlist",
1164
+ security_source: @sdk_configuration.security_source
1165
+ )
1166
+
1167
+ error = T.let(nil, T.nilable(StandardError))
1168
+ http_response = T.let(nil, T.nilable(Faraday::Response))
1169
+
1170
+ begin
1171
+ http_response = T.must(connection).delete(url) do |req|
1172
+ req.headers.merge!(headers)
1173
+ req.options.timeout = timeout unless timeout.nil?
1174
+ Utils.configure_request_security(req, security)
1175
+ http_headers&.each do |key, value|
1176
+ req.headers[key.to_s] = value
1177
+ end
1178
+
1179
+ @sdk_configuration.hooks.before_request(
1180
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
1181
+ hook_ctx: hook_ctx
1182
+ ),
1183
+ request: req
1184
+ )
1185
+ end
1186
+
1187
+ rescue StandardError => e
1188
+ error = e
1189
+ ensure
1190
+ if http_response.nil? || Utils.error_status?(http_response.status)
1191
+ http_response = @sdk_configuration.hooks.after_error(
1192
+ error: error,
1193
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
1194
+ hook_ctx: hook_ctx
1195
+ ),
1196
+ response: http_response
1197
+ )
1198
+ else
1199
+ http_response = @sdk_configuration.hooks.after_success(
1200
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1201
+ hook_ctx: hook_ctx
1202
+ ),
1203
+ response: http_response
1204
+ )
1205
+ end
1206
+
1207
+ if http_response.nil?
1208
+ raise error if !error.nil?
1209
+ raise "no response"
1210
+ end
1211
+ end
1212
+
1213
+ content_type = http_response.headers.fetch("Content-Type", "application/octet-stream")
1214
+ if Utils.match_status_code(http_response.status, ["200"])
1215
+ if Utils.match_content_type(content_type, "application/json")
1216
+ http_response = @sdk_configuration.hooks.after_success(
1217
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1218
+ hook_ctx: hook_ctx
1219
+ ),
1220
+ response: http_response
1221
+ )
1222
+ response_data = http_response.env.response_body
1223
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DeleteWordlistResponseBody)
1224
+ response = Models::Operations::DeleteWordlistResponse.new(
1225
+ status_code: http_response.status,
1226
+ content_type: content_type,
1227
+ raw_response: http_response,
1228
+ object: T.unsafe(obj)
1229
+ )
1230
+
1231
+ return response
1232
+ else
1233
+ raise(
1234
+ ::ModerationApi::Models::Errors::APIError.new(
1235
+ status_code: http_response.status,
1236
+ body: http_response.env.response_body,
1237
+ raw_response: http_response
1238
+ ),
1239
+ "Unknown content type received"
1240
+ )
1241
+ end
1242
+ elsif Utils.match_status_code(http_response.status, ["401"])
1243
+ if Utils.match_content_type(content_type, "application/json")
1244
+ http_response = @sdk_configuration.hooks.after_success(
1245
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1246
+ hook_ctx: hook_ctx
1247
+ ),
1248
+ response: http_response
1249
+ )
1250
+ response_data = http_response.env.response_body
1251
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError)
1252
+ obj.raw_response = http_response
1253
+ raise obj
1254
+ else
1255
+ raise(
1256
+ ::ModerationApi::Models::Errors::APIError.new(
1257
+ status_code: http_response.status,
1258
+ body: http_response.env.response_body,
1259
+ raw_response: http_response
1260
+ ),
1261
+ "Unknown content type received"
1262
+ )
1263
+ end
1264
+ elsif Utils.match_status_code(http_response.status, ["404"])
1265
+ if Utils.match_content_type(content_type, "application/json")
1266
+ http_response = @sdk_configuration.hooks.after_success(
1267
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1268
+ hook_ctx: hook_ctx
1269
+ ),
1270
+ response: http_response
1271
+ )
1272
+ response_data = http_response.env.response_body
1273
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError)
1274
+ obj.raw_response = http_response
1275
+ raise obj
1276
+ else
1277
+ raise(
1278
+ ::ModerationApi::Models::Errors::APIError.new(
1279
+ status_code: http_response.status,
1280
+ body: http_response.env.response_body,
1281
+ raw_response: http_response
1282
+ ),
1283
+ "Unknown content type received"
1284
+ )
1285
+ end
1286
+ elsif Utils.match_status_code(http_response.status, ["429"])
1287
+ if Utils.match_content_type(content_type, "application/json")
1288
+ http_response = @sdk_configuration.hooks.after_success(
1289
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
1290
+ hook_ctx: hook_ctx
1291
+ ),
1292
+ response: http_response
1293
+ )
1294
+ response_data = http_response.env.response_body
1295
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError)
1296
+ obj.raw_response = http_response
1297
+ raise obj
1298
+ else
1299
+ raise(
1300
+ ::ModerationApi::Models::Errors::APIError.new(
1301
+ status_code: http_response.status,
1302
+ body: http_response.env.response_body,
1303
+ raw_response: http_response
1304
+ ),
1305
+ "Unknown content type received"
1306
+ )
1307
+ end
1308
+ elsif Utils.match_status_code(http_response.status, ["4XX"])
1309
+ raise(
1310
+ ::ModerationApi::Models::Errors::APIError.new(
1311
+ status_code: http_response.status,
1312
+ body: http_response.env.response_body,
1313
+ raw_response: http_response
1314
+ ),
1315
+ "API error occurred"
1316
+ )
1317
+ elsif Utils.match_status_code(http_response.status, ["5XX"])
1318
+ raise(
1319
+ ::ModerationApi::Models::Errors::APIError.new(
1320
+ status_code: http_response.status,
1321
+ body: http_response.env.response_body,
1322
+ raw_response: http_response
1323
+ ),
1324
+ "API error occurred"
1325
+ )
1326
+ else
1327
+ raise(
1328
+ ::ModerationApi::Models::Errors::APIError.new(
1329
+ status_code: http_response.status,
1330
+ body: http_response.env.response_body,
1331
+ raw_response: http_response
1332
+ ),
1333
+ "Unknown status code received"
1334
+ )
1335
+
1336
+ end
1337
+ end
1338
+
1123
1339
  sig {
1124
1340
  params(
1125
1341
  id: ::String,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moderation_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moderation API
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-28 00:00:00.000000000 Z
11
+ date: 2026-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -574,6 +574,12 @@ files:
574
574
  - lib/moderation_api/models/operations/deletewebhook_response.rbi
575
575
  - lib/moderation_api/models/operations/deletewebhook_responsebody.rb
576
576
  - lib/moderation_api/models/operations/deletewebhook_responsebody.rbi
577
+ - lib/moderation_api/models/operations/deletewordlist_request.rb
578
+ - lib/moderation_api/models/operations/deletewordlist_request.rbi
579
+ - lib/moderation_api/models/operations/deletewordlist_response.rb
580
+ - lib/moderation_api/models/operations/deletewordlist_response.rbi
581
+ - lib/moderation_api/models/operations/deletewordlist_responsebody.rb
582
+ - lib/moderation_api/models/operations/deletewordlist_responsebody.rbi
577
583
  - lib/moderation_api/models/operations/drugs.rb
578
584
  - lib/moderation_api/models/operations/drugs.rbi
579
585
  - lib/moderation_api/models/operations/duplicatechannel_request.rb