moderation_api 2.20.0 → 2.22.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: bb51c2dd8cbf252b7777f03017d7d3b4b3afc2a204113f917a40704e8789b5e3
4
- data.tar.gz: 67a4613735a19a3c93b42a75f74d5468c29760ee6902e2147d56878d94d79008
3
+ metadata.gz: 702ad6b875faa58c838f59c5232b99a125ed63502886583bbfa3236e0e447bb2
4
+ data.tar.gz: c7c420f51bf7be8c8f5442b854f4061df43ae5ffa343303d60db1855ac5beb68
5
5
  SHA512:
6
- metadata.gz: 6e0af9a126dcf53dd8d3a33a8a1f7f22c3ec1bbde86b735404d7954c9ff07a799b721b5785212c01d1403eb8f861b2786d52d5bf6e352e555aa2f29fefb114c7
7
- data.tar.gz: bb6320deed400febf5e17485a176a0e3acf0ac0d3a4715e664de2a7215d5c5d74294c26dc4d47987982db6a3ebbfe980acb0ef30bec2cdb77c1364d3a67b16ef
6
+ metadata.gz: 4428e4355dc7b2b8e9b5bcf0a2929c36eb5078d02812dff5f1f52d932a38303b5d8bac87167d968475035a5919e037037fe71d4790ad464bee2f90f67460e2fe
7
+ data.tar.gz: 1383d052a974cf8fbfa1c00f800b1cc7cb2e47790b5efeb517792d97e099d2e800711ac8280f56bdbf37c70ceb6a6220f0b4b8c8be596c8c0f321c769bed0927
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.22.0 (2026-06-02)
4
+
5
+ Full Changelog: [v2.21.0...v2.22.0](https://github.com/moderation-api/sdk-ruby/compare/v2.21.0...v2.22.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([f04cbbf](https://github.com/moderation-api/sdk-ruby/commit/f04cbbf7be3373c6a08b3e0192e5ba45690e962f))
10
+
11
+ ## 2.21.0 (2026-06-02)
12
+
13
+ Full Changelog: [v2.20.0...v2.21.0](https://github.com/moderation-api/sdk-ruby/compare/v2.20.0...v2.21.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** api update ([250e1b4](https://github.com/moderation-api/sdk-ruby/commit/250e1b4849fff5f9dfe39c267b4641c23fc46358))
18
+
3
19
  ## 2.20.0 (2026-06-01)
4
20
 
5
21
  Full Changelog: [v2.19.0...v2.20.0](https://github.com/moderation-api/sdk-ruby/compare/v2.19.0...v2.20.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "moderation_api", "~> 2.20.0"
18
+ gem "moderation_api", "~> 2.22.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -26,6 +26,18 @@ module ModerationAPI
26
26
  # @return [String, nil]
27
27
  optional :channel, String
28
28
 
29
+ # @!attribute client_action
30
+ # A recommendation from your own client-side flagging (e.g. a banned-IP list or a
31
+ # third-party tool). Feeds the rules engine and can escalate or override the
32
+ # recommended action. Does not change whether our analysis flagged the content.
33
+ #
34
+ # @return [ModerationAPI::Models::ContentSubmitParams::ClientAction, nil]
35
+ optional :client_action,
36
+ -> {
37
+ ModerationAPI::ContentSubmitParams::ClientAction
38
+ },
39
+ api_name: :clientAction
40
+
29
41
  # @!attribute content_id
30
42
  # The unique ID of the content in your database.
31
43
  #
@@ -70,7 +82,7 @@ module ModerationAPI
70
82
  # @return [Float, nil]
71
83
  optional :timestamp, Float
72
84
 
73
- # @!method initialize(content:, author_id: nil, channel: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {})
85
+ # @!method initialize(content:, author_id: nil, channel: nil, client_action: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {})
74
86
  # Some parameter documentations has been truncated, see
75
87
  # {ModerationAPI::Models::ContentSubmitParams} for more details.
76
88
  #
@@ -80,6 +92,8 @@ module ModerationAPI
80
92
  #
81
93
  # @param channel [String] Provide a channel ID or key. Will use the project's default channel if not provi
82
94
  #
95
+ # @param client_action [ModerationAPI::Models::ContentSubmitParams::ClientAction] A recommendation from your own client-side flagging (e.g. a banned-IP list or a
96
+ #
83
97
  # @param content_id [String] The unique ID of the content in your database.
84
98
  #
85
99
  # @param conversation_id [String] For example the ID of a chat room or a post
@@ -345,6 +359,77 @@ module ModerationAPI
345
359
  # @return [Array(ModerationAPI::Models::ContentSubmitParams::Content::Text, ModerationAPI::Models::ContentSubmitParams::Content::Image, ModerationAPI::Models::ContentSubmitParams::Content::Video, ModerationAPI::Models::ContentSubmitParams::Content::Audio, ModerationAPI::Models::ContentSubmitParams::Content::Object)]
346
360
  end
347
361
 
362
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
363
+ # @!attribute action
364
+ # Your recommendation for the content: allow, review, or reject.
365
+ #
366
+ # @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action]
367
+ required :action, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Action }
368
+
369
+ # @!attribute behavior
370
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
371
+ # applies it when stricter than ours; 'override' replaces ours outright.
372
+ #
373
+ # @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior, nil]
374
+ optional :behavior, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Behavior }
375
+
376
+ # @!attribute reason
377
+ # A human-readable explanation for your recommendation.
378
+ #
379
+ # @return [String, nil]
380
+ optional :reason, String
381
+
382
+ # @!attribute source
383
+ # Where your recommendation came from, e.g. "banned-ip".
384
+ #
385
+ # @return [String, nil]
386
+ optional :source, String
387
+
388
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
389
+ # Some parameter documentations has been truncated, see
390
+ # {ModerationAPI::Models::ContentSubmitParams::ClientAction} for more details.
391
+ #
392
+ # A recommendation from your own client-side flagging (e.g. a banned-IP list or a
393
+ # third-party tool). Feeds the rules engine and can escalate or override the
394
+ # recommended action. Does not change whether our analysis flagged the content.
395
+ #
396
+ # @param action [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
397
+ #
398
+ # @param behavior [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
399
+ #
400
+ # @param reason [String] A human-readable explanation for your recommendation.
401
+ #
402
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
403
+
404
+ # Your recommendation for the content: allow, review, or reject.
405
+ #
406
+ # @see ModerationAPI::Models::ContentSubmitParams::ClientAction#action
407
+ module Action
408
+ extend ModerationAPI::Internal::Type::Enum
409
+
410
+ REVIEW = :review
411
+ ALLOW = :allow
412
+ REJECT = :reject
413
+
414
+ # @!method self.values
415
+ # @return [Array<Symbol>]
416
+ end
417
+
418
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
419
+ # applies it when stricter than ours; 'override' replaces ours outright.
420
+ #
421
+ # @see ModerationAPI::Models::ContentSubmitParams::ClientAction#behavior
422
+ module Behavior
423
+ extend ModerationAPI::Internal::Type::Enum
424
+
425
+ OVERRIDE = :override
426
+ ESCALATE = :escalate
427
+
428
+ # @!method self.values
429
+ # @return [Array<Symbol>]
430
+ end
431
+ end
432
+
348
433
  # The meta type of content being moderated
349
434
  module MetaType
350
435
  extend ModerationAPI::Internal::Type::Enum
@@ -907,6 +907,7 @@ module ModerationAPI
907
907
  RULE_MATCH = :rule_match
908
908
  RULE_DEFAULT = :rule_default
909
909
  RULE_FALLBACK = :rule_fallback
910
+ CLIENT_OVERRIDE = :client_override
910
911
 
911
912
  # @!method self.values
912
913
  # @return [Array<Symbol>]