moderation_api 2.20.0 → 2.21.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: 547864fb63b08b0a2b9f6a917a87c37987466412e68df8d2d590d79443960126
4
+ data.tar.gz: 171fd0eab7ed0d611f8ae8568e4f1901393c890eb41246f70aa882363d960c1d
5
5
  SHA512:
6
- metadata.gz: 6e0af9a126dcf53dd8d3a33a8a1f7f22c3ec1bbde86b735404d7954c9ff07a799b721b5785212c01d1403eb8f861b2786d52d5bf6e352e555aa2f29fefb114c7
7
- data.tar.gz: bb6320deed400febf5e17485a176a0e3acf0ac0d3a4715e664de2a7215d5c5d74294c26dc4d47987982db6a3ebbfe980acb0ef30bec2cdb77c1364d3a67b16ef
6
+ metadata.gz: f4b4033ca81af4592e37b7b42d22058dbc7f2599c5e7824c34846f3196b69aac3e211555826c98d27a6c33d2bbe233ae0ef94918936313e50b56a3e084ffb1af
7
+ data.tar.gz: dd338f50d8e682d74d2010aa7a4727dd6e1ae1458c7399f921b7ad08ccc39545ccf53959e1d473d60a85dfd401590285cb725027d140a58cbdddd61f3485bb5a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.21.0 (2026-06-02)
4
+
5
+ Full Changelog: [v2.20.0...v2.21.0](https://github.com/moderation-api/sdk-ruby/compare/v2.20.0...v2.21.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([250e1b4](https://github.com/moderation-api/sdk-ruby/commit/250e1b4849fff5f9dfe39c267b4641c23fc46358))
10
+
3
11
  ## 2.20.0 (2026-06-01)
4
12
 
5
13
  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.21.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>]
@@ -2435,6 +2435,16 @@ module ModerationAPI
2435
2435
  # @return [String, nil]
2436
2436
  required :channel_key, String, nil?: true
2437
2437
 
2438
+ # @!attribute client_action
2439
+ # A recommendation from your own client-side flagging.
2440
+ #
2441
+ # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction, nil]
2442
+ required :client_action,
2443
+ -> {
2444
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction
2445
+ },
2446
+ nil?: true
2447
+
2438
2448
  # @!attribute content
2439
2449
  # The original content payload
2440
2450
  #
@@ -2496,7 +2506,7 @@ module ModerationAPI
2496
2506
  # @return [Time]
2497
2507
  required :timestamp, Time
2498
2508
 
2499
- # @!method initialize(id:, author_id:, channel_key:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
2509
+ # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
2500
2510
  # Some parameter documentations has been truncated, see
2501
2511
  # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item} for
2502
2512
  # more details.
@@ -2507,6 +2517,8 @@ module ModerationAPI
2507
2517
  #
2508
2518
  # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch
2509
2519
  #
2520
+ # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging.
2521
+ #
2510
2522
  # @param content [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object] The original content payload
2511
2523
  #
2512
2524
  # @param conversation_id [String, nil] Conversation grouping ID, if any
@@ -2523,6 +2535,79 @@ module ModerationAPI
2523
2535
  #
2524
2536
  # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted
2525
2537
 
2538
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item#client_action
2539
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
2540
+ # @!attribute action
2541
+ # Your recommendation for the content: allow, review, or reject.
2542
+ #
2543
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action]
2544
+ required :action,
2545
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action }
2546
+
2547
+ # @!attribute behavior
2548
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
2549
+ # applies it when stricter than ours; 'override' replaces ours outright.
2550
+ #
2551
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior, nil]
2552
+ optional :behavior,
2553
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior }
2554
+
2555
+ # @!attribute reason
2556
+ # A human-readable explanation for your recommendation.
2557
+ #
2558
+ # @return [String, nil]
2559
+ optional :reason, String
2560
+
2561
+ # @!attribute source
2562
+ # Where your recommendation came from, e.g. "banned-ip".
2563
+ #
2564
+ # @return [String, nil]
2565
+ optional :source, String
2566
+
2567
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
2568
+ # Some parameter documentations has been truncated, see
2569
+ # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction}
2570
+ # for more details.
2571
+ #
2572
+ # A recommendation from your own client-side flagging.
2573
+ #
2574
+ # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
2575
+ #
2576
+ # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
2577
+ #
2578
+ # @param reason [String] A human-readable explanation for your recommendation.
2579
+ #
2580
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
2581
+
2582
+ # Your recommendation for the content: allow, review, or reject.
2583
+ #
2584
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction#action
2585
+ module Action
2586
+ extend ModerationAPI::Internal::Type::Enum
2587
+
2588
+ REVIEW = :review
2589
+ ALLOW = :allow
2590
+ REJECT = :reject
2591
+
2592
+ # @!method self.values
2593
+ # @return [Array<Symbol>]
2594
+ end
2595
+
2596
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
2597
+ # applies it when stricter than ours; 'override' replaces ours outright.
2598
+ #
2599
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction#behavior
2600
+ module Behavior
2601
+ extend ModerationAPI::Internal::Type::Enum
2602
+
2603
+ OVERRIDE = :override
2604
+ ESCALATE = :escalate
2605
+
2606
+ # @!method self.values
2607
+ # @return [Array<Symbol>]
2608
+ end
2609
+ end
2610
+
2526
2611
  # The original content payload
2527
2612
  #
2528
2613
  # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item#content
@@ -3699,6 +3784,14 @@ module ModerationAPI
3699
3784
  # @return [String, nil]
3700
3785
  required :channel_key, String, nil?: true
3701
3786
 
3787
+ # @!attribute client_action
3788
+ # A recommendation from your own client-side flagging.
3789
+ #
3790
+ # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction, nil]
3791
+ required :client_action,
3792
+ -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction },
3793
+ nil?: true
3794
+
3702
3795
  # @!attribute content
3703
3796
  # The original content payload
3704
3797
  #
@@ -3759,7 +3852,7 @@ module ModerationAPI
3759
3852
  # @return [Time]
3760
3853
  required :timestamp, Time
3761
3854
 
3762
- # @!method initialize(id:, author_id:, channel_key:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
3855
+ # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
3763
3856
  # Some parameter documentations has been truncated, see
3764
3857
  # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item} for
3765
3858
  # more details.
@@ -3772,6 +3865,8 @@ module ModerationAPI
3772
3865
  #
3773
3866
  # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch
3774
3867
  #
3868
+ # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging.
3869
+ #
3775
3870
  # @param content [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object] The original content payload
3776
3871
  #
3777
3872
  # @param conversation_id [String, nil] Conversation grouping ID, if any
@@ -3788,6 +3883,79 @@ module ModerationAPI
3788
3883
  #
3789
3884
  # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted
3790
3885
 
3886
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item#client_action
3887
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
3888
+ # @!attribute action
3889
+ # Your recommendation for the content: allow, review, or reject.
3890
+ #
3891
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action]
3892
+ required :action,
3893
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action }
3894
+
3895
+ # @!attribute behavior
3896
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
3897
+ # applies it when stricter than ours; 'override' replaces ours outright.
3898
+ #
3899
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior, nil]
3900
+ optional :behavior,
3901
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior }
3902
+
3903
+ # @!attribute reason
3904
+ # A human-readable explanation for your recommendation.
3905
+ #
3906
+ # @return [String, nil]
3907
+ optional :reason, String
3908
+
3909
+ # @!attribute source
3910
+ # Where your recommendation came from, e.g. "banned-ip".
3911
+ #
3912
+ # @return [String, nil]
3913
+ optional :source, String
3914
+
3915
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
3916
+ # Some parameter documentations has been truncated, see
3917
+ # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction}
3918
+ # for more details.
3919
+ #
3920
+ # A recommendation from your own client-side flagging.
3921
+ #
3922
+ # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
3923
+ #
3924
+ # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
3925
+ #
3926
+ # @param reason [String] A human-readable explanation for your recommendation.
3927
+ #
3928
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
3929
+
3930
+ # Your recommendation for the content: allow, review, or reject.
3931
+ #
3932
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction#action
3933
+ module Action
3934
+ extend ModerationAPI::Internal::Type::Enum
3935
+
3936
+ REVIEW = :review
3937
+ ALLOW = :allow
3938
+ REJECT = :reject
3939
+
3940
+ # @!method self.values
3941
+ # @return [Array<Symbol>]
3942
+ end
3943
+
3944
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
3945
+ # applies it when stricter than ours; 'override' replaces ours outright.
3946
+ #
3947
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction#behavior
3948
+ module Behavior
3949
+ extend ModerationAPI::Internal::Type::Enum
3950
+
3951
+ OVERRIDE = :override
3952
+ ESCALATE = :escalate
3953
+
3954
+ # @!method self.values
3955
+ # @return [Array<Symbol>]
3956
+ end
3957
+ end
3958
+
3791
3959
  # The original content payload
3792
3960
  #
3793
3961
  # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item#content
@@ -4682,6 +4850,16 @@ module ModerationAPI
4682
4850
  # @return [String, nil]
4683
4851
  required :channel_key, String, nil?: true
4684
4852
 
4853
+ # @!attribute client_action
4854
+ # A recommendation from your own client-side flagging.
4855
+ #
4856
+ # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction, nil]
4857
+ required :client_action,
4858
+ -> {
4859
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction
4860
+ },
4861
+ nil?: true
4862
+
4685
4863
  # @!attribute content
4686
4864
  # The original content payload
4687
4865
  #
@@ -4743,7 +4921,7 @@ module ModerationAPI
4743
4921
  # @return [Time]
4744
4922
  required :timestamp, Time
4745
4923
 
4746
- # @!method initialize(id:, author_id:, channel_key:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
4924
+ # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
4747
4925
  # Some parameter documentations has been truncated, see
4748
4926
  # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item} for
4749
4927
  # more details.
@@ -4756,6 +4934,8 @@ module ModerationAPI
4756
4934
  #
4757
4935
  # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch
4758
4936
  #
4937
+ # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging.
4938
+ #
4759
4939
  # @param content [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object] The original content payload
4760
4940
  #
4761
4941
  # @param conversation_id [String, nil] Conversation grouping ID, if any
@@ -4772,6 +4952,79 @@ module ModerationAPI
4772
4952
  #
4773
4953
  # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted
4774
4954
 
4955
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item#client_action
4956
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
4957
+ # @!attribute action
4958
+ # Your recommendation for the content: allow, review, or reject.
4959
+ #
4960
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action]
4961
+ required :action,
4962
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action }
4963
+
4964
+ # @!attribute behavior
4965
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
4966
+ # applies it when stricter than ours; 'override' replaces ours outright.
4967
+ #
4968
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior, nil]
4969
+ optional :behavior,
4970
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior }
4971
+
4972
+ # @!attribute reason
4973
+ # A human-readable explanation for your recommendation.
4974
+ #
4975
+ # @return [String, nil]
4976
+ optional :reason, String
4977
+
4978
+ # @!attribute source
4979
+ # Where your recommendation came from, e.g. "banned-ip".
4980
+ #
4981
+ # @return [String, nil]
4982
+ optional :source, String
4983
+
4984
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
4985
+ # Some parameter documentations has been truncated, see
4986
+ # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction}
4987
+ # for more details.
4988
+ #
4989
+ # A recommendation from your own client-side flagging.
4990
+ #
4991
+ # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
4992
+ #
4993
+ # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
4994
+ #
4995
+ # @param reason [String] A human-readable explanation for your recommendation.
4996
+ #
4997
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
4998
+
4999
+ # Your recommendation for the content: allow, review, or reject.
5000
+ #
5001
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction#action
5002
+ module Action
5003
+ extend ModerationAPI::Internal::Type::Enum
5004
+
5005
+ REVIEW = :review
5006
+ ALLOW = :allow
5007
+ REJECT = :reject
5008
+
5009
+ # @!method self.values
5010
+ # @return [Array<Symbol>]
5011
+ end
5012
+
5013
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
5014
+ # applies it when stricter than ours; 'override' replaces ours outright.
5015
+ #
5016
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction#behavior
5017
+ module Behavior
5018
+ extend ModerationAPI::Internal::Type::Enum
5019
+
5020
+ OVERRIDE = :override
5021
+ ESCALATE = :escalate
5022
+
5023
+ # @!method self.values
5024
+ # @return [Array<Symbol>]
5025
+ end
5026
+ end
5027
+
4775
5028
  # The original content payload
4776
5029
  #
4777
5030
  # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item#content
@@ -5665,6 +5918,14 @@ module ModerationAPI
5665
5918
  # @return [String, nil]
5666
5919
  required :channel_key, String, nil?: true
5667
5920
 
5921
+ # @!attribute client_action
5922
+ # A recommendation from your own client-side flagging.
5923
+ #
5924
+ # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction, nil]
5925
+ required :client_action,
5926
+ -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction },
5927
+ nil?: true
5928
+
5668
5929
  # @!attribute content
5669
5930
  # The original content payload
5670
5931
  #
@@ -5726,7 +5987,7 @@ module ModerationAPI
5726
5987
  # @return [Time]
5727
5988
  required :timestamp, Time
5728
5989
 
5729
- # @!method initialize(id:, author_id:, channel_key:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
5990
+ # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
5730
5991
  # Some parameter documentations has been truncated, see
5731
5992
  # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item} for
5732
5993
  # more details.
@@ -5739,6 +6000,8 @@ module ModerationAPI
5739
6000
  #
5740
6001
  # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch
5741
6002
  #
6003
+ # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging.
6004
+ #
5742
6005
  # @param content [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object] The original content payload
5743
6006
  #
5744
6007
  # @param conversation_id [String, nil] Conversation grouping ID, if any
@@ -5755,6 +6018,79 @@ module ModerationAPI
5755
6018
  #
5756
6019
  # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted
5757
6020
 
6021
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item#client_action
6022
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
6023
+ # @!attribute action
6024
+ # Your recommendation for the content: allow, review, or reject.
6025
+ #
6026
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action]
6027
+ required :action,
6028
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action }
6029
+
6030
+ # @!attribute behavior
6031
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
6032
+ # applies it when stricter than ours; 'override' replaces ours outright.
6033
+ #
6034
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior, nil]
6035
+ optional :behavior,
6036
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior }
6037
+
6038
+ # @!attribute reason
6039
+ # A human-readable explanation for your recommendation.
6040
+ #
6041
+ # @return [String, nil]
6042
+ optional :reason, String
6043
+
6044
+ # @!attribute source
6045
+ # Where your recommendation came from, e.g. "banned-ip".
6046
+ #
6047
+ # @return [String, nil]
6048
+ optional :source, String
6049
+
6050
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
6051
+ # Some parameter documentations has been truncated, see
6052
+ # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction}
6053
+ # for more details.
6054
+ #
6055
+ # A recommendation from your own client-side flagging.
6056
+ #
6057
+ # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
6058
+ #
6059
+ # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
6060
+ #
6061
+ # @param reason [String] A human-readable explanation for your recommendation.
6062
+ #
6063
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
6064
+
6065
+ # Your recommendation for the content: allow, review, or reject.
6066
+ #
6067
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction#action
6068
+ module Action
6069
+ extend ModerationAPI::Internal::Type::Enum
6070
+
6071
+ REVIEW = :review
6072
+ ALLOW = :allow
6073
+ REJECT = :reject
6074
+
6075
+ # @!method self.values
6076
+ # @return [Array<Symbol>]
6077
+ end
6078
+
6079
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
6080
+ # applies it when stricter than ours; 'override' replaces ours outright.
6081
+ #
6082
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction#behavior
6083
+ module Behavior
6084
+ extend ModerationAPI::Internal::Type::Enum
6085
+
6086
+ OVERRIDE = :override
6087
+ ESCALATE = :escalate
6088
+
6089
+ # @!method self.values
6090
+ # @return [Array<Symbol>]
6091
+ end
6092
+ end
6093
+
5758
6094
  # The original content payload
5759
6095
  #
5760
6096
  # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item#content
@@ -6,7 +6,7 @@ module ModerationAPI
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {ModerationAPI::Models::ContentSubmitParams} for more details.
8
8
  #
9
- # @overload submit(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: {})
9
+ # @overload submit(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: {})
10
10
  #
11
11
  # @param content [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] The content sent for moderation
12
12
  #
@@ -14,6 +14,8 @@ module ModerationAPI
14
14
  #
15
15
  # @param channel [String] Provide a channel ID or key. Will use the project's default channel if not provi
16
16
  #
17
+ # @param client_action [ModerationAPI::Models::ContentSubmitParams::ClientAction] A recommendation from your own client-side flagging (e.g. a banned-IP list or a
18
+ #
17
19
  # @param content_id [String] The unique ID of the content in your database.
18
20
  #
19
21
  # @param conversation_id [String] For example the ID of a chat room or a post
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ModerationAPI
4
- VERSION = "2.20.0"
4
+ VERSION = "2.21.0"
5
5
  end