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.
@@ -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
  #
@@ -2454,6 +2464,13 @@ module ModerationAPI
2454
2464
  # @return [Boolean, nil]
2455
2465
  required :flagged, ModerationAPI::Internal::Type::Boolean, nil?: true
2456
2466
 
2467
+ # @!attribute flagged_fields
2468
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
2469
+ # when no fields were flagged or the content is not an object.
2470
+ #
2471
+ # @return [Array<String>]
2472
+ required :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String]
2473
+
2457
2474
  # @!attribute labels
2458
2475
  # Moderation labels applied to the content
2459
2476
  #
@@ -2496,7 +2513,7 @@ module ModerationAPI
2496
2513
  # @return [Time]
2497
2514
  required :timestamp, Time
2498
2515
 
2499
- # @!method initialize(id:, author_id:, channel_key:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
2516
+ # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, flagged_fields:, labels:, language:, meta_type:, metadata:, timestamp:)
2500
2517
  # Some parameter documentations has been truncated, see
2501
2518
  # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item} for
2502
2519
  # more details.
@@ -2507,12 +2524,16 @@ module ModerationAPI
2507
2524
  #
2508
2525
  # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch
2509
2526
  #
2527
+ # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging.
2528
+ #
2510
2529
  # @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
2530
  #
2512
2531
  # @param conversation_id [String, nil] Conversation grouping ID, if any
2513
2532
  #
2514
2533
  # @param flagged [Boolean, nil] Whether the content was flagged by moderation
2515
2534
  #
2535
+ # @param flagged_fields [Array<String>] For object content, the field keys (e.g. "bio") that triggered a flag. Empty whe
2536
+ #
2516
2537
  # @param labels [Array<ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label>, nil] Moderation labels applied to the content
2517
2538
  #
2518
2539
  # @param language [String, nil] Detected ISO language code, if available
@@ -2523,6 +2544,79 @@ module ModerationAPI
2523
2544
  #
2524
2545
  # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted
2525
2546
 
2547
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item#client_action
2548
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
2549
+ # @!attribute action
2550
+ # Your recommendation for the content: allow, review, or reject.
2551
+ #
2552
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action]
2553
+ required :action,
2554
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action }
2555
+
2556
+ # @!attribute behavior
2557
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
2558
+ # applies it when stricter than ours; 'override' replaces ours outright.
2559
+ #
2560
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior, nil]
2561
+ optional :behavior,
2562
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior }
2563
+
2564
+ # @!attribute reason
2565
+ # A human-readable explanation for your recommendation.
2566
+ #
2567
+ # @return [String, nil]
2568
+ optional :reason, String
2569
+
2570
+ # @!attribute source
2571
+ # Where your recommendation came from, e.g. "banned-ip".
2572
+ #
2573
+ # @return [String, nil]
2574
+ optional :source, String
2575
+
2576
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
2577
+ # Some parameter documentations has been truncated, see
2578
+ # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction}
2579
+ # for more details.
2580
+ #
2581
+ # A recommendation from your own client-side flagging.
2582
+ #
2583
+ # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
2584
+ #
2585
+ # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
2586
+ #
2587
+ # @param reason [String] A human-readable explanation for your recommendation.
2588
+ #
2589
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
2590
+
2591
+ # Your recommendation for the content: allow, review, or reject.
2592
+ #
2593
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction#action
2594
+ module Action
2595
+ extend ModerationAPI::Internal::Type::Enum
2596
+
2597
+ REVIEW = :review
2598
+ ALLOW = :allow
2599
+ REJECT = :reject
2600
+
2601
+ # @!method self.values
2602
+ # @return [Array<Symbol>]
2603
+ end
2604
+
2605
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
2606
+ # applies it when stricter than ours; 'override' replaces ours outright.
2607
+ #
2608
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction#behavior
2609
+ module Behavior
2610
+ extend ModerationAPI::Internal::Type::Enum
2611
+
2612
+ OVERRIDE = :override
2613
+ ESCALATE = :escalate
2614
+
2615
+ # @!method self.values
2616
+ # @return [Array<Symbol>]
2617
+ end
2618
+ end
2619
+
2526
2620
  # The original content payload
2527
2621
  #
2528
2622
  # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item#content
@@ -3699,6 +3793,14 @@ module ModerationAPI
3699
3793
  # @return [String, nil]
3700
3794
  required :channel_key, String, nil?: true
3701
3795
 
3796
+ # @!attribute client_action
3797
+ # A recommendation from your own client-side flagging.
3798
+ #
3799
+ # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction, nil]
3800
+ required :client_action,
3801
+ -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction },
3802
+ nil?: true
3803
+
3702
3804
  # @!attribute content
3703
3805
  # The original content payload
3704
3806
  #
@@ -3717,6 +3819,13 @@ module ModerationAPI
3717
3819
  # @return [Boolean, nil]
3718
3820
  required :flagged, ModerationAPI::Internal::Type::Boolean, nil?: true
3719
3821
 
3822
+ # @!attribute flagged_fields
3823
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
3824
+ # when no fields were flagged or the content is not an object.
3825
+ #
3826
+ # @return [Array<String>]
3827
+ required :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String]
3828
+
3720
3829
  # @!attribute labels
3721
3830
  # Moderation labels applied to the content
3722
3831
  #
@@ -3759,7 +3868,7 @@ module ModerationAPI
3759
3868
  # @return [Time]
3760
3869
  required :timestamp, Time
3761
3870
 
3762
- # @!method initialize(id:, author_id:, channel_key:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
3871
+ # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, flagged_fields:, labels:, language:, meta_type:, metadata:, timestamp:)
3763
3872
  # Some parameter documentations has been truncated, see
3764
3873
  # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item} for
3765
3874
  # more details.
@@ -3772,12 +3881,16 @@ module ModerationAPI
3772
3881
  #
3773
3882
  # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch
3774
3883
  #
3884
+ # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging.
3885
+ #
3775
3886
  # @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
3887
  #
3777
3888
  # @param conversation_id [String, nil] Conversation grouping ID, if any
3778
3889
  #
3779
3890
  # @param flagged [Boolean, nil] Whether the content was flagged by moderation
3780
3891
  #
3892
+ # @param flagged_fields [Array<String>] For object content, the field keys (e.g. "bio") that triggered a flag. Empty whe
3893
+ #
3781
3894
  # @param labels [Array<ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label>, nil] Moderation labels applied to the content
3782
3895
  #
3783
3896
  # @param language [String, nil] Detected ISO language code, if available
@@ -3788,6 +3901,79 @@ module ModerationAPI
3788
3901
  #
3789
3902
  # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted
3790
3903
 
3904
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item#client_action
3905
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
3906
+ # @!attribute action
3907
+ # Your recommendation for the content: allow, review, or reject.
3908
+ #
3909
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action]
3910
+ required :action,
3911
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action }
3912
+
3913
+ # @!attribute behavior
3914
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
3915
+ # applies it when stricter than ours; 'override' replaces ours outright.
3916
+ #
3917
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior, nil]
3918
+ optional :behavior,
3919
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior }
3920
+
3921
+ # @!attribute reason
3922
+ # A human-readable explanation for your recommendation.
3923
+ #
3924
+ # @return [String, nil]
3925
+ optional :reason, String
3926
+
3927
+ # @!attribute source
3928
+ # Where your recommendation came from, e.g. "banned-ip".
3929
+ #
3930
+ # @return [String, nil]
3931
+ optional :source, String
3932
+
3933
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
3934
+ # Some parameter documentations has been truncated, see
3935
+ # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction}
3936
+ # for more details.
3937
+ #
3938
+ # A recommendation from your own client-side flagging.
3939
+ #
3940
+ # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
3941
+ #
3942
+ # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
3943
+ #
3944
+ # @param reason [String] A human-readable explanation for your recommendation.
3945
+ #
3946
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
3947
+
3948
+ # Your recommendation for the content: allow, review, or reject.
3949
+ #
3950
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction#action
3951
+ module Action
3952
+ extend ModerationAPI::Internal::Type::Enum
3953
+
3954
+ REVIEW = :review
3955
+ ALLOW = :allow
3956
+ REJECT = :reject
3957
+
3958
+ # @!method self.values
3959
+ # @return [Array<Symbol>]
3960
+ end
3961
+
3962
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
3963
+ # applies it when stricter than ours; 'override' replaces ours outright.
3964
+ #
3965
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction#behavior
3966
+ module Behavior
3967
+ extend ModerationAPI::Internal::Type::Enum
3968
+
3969
+ OVERRIDE = :override
3970
+ ESCALATE = :escalate
3971
+
3972
+ # @!method self.values
3973
+ # @return [Array<Symbol>]
3974
+ end
3975
+ end
3976
+
3791
3977
  # The original content payload
3792
3978
  #
3793
3979
  # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item#content
@@ -4682,6 +4868,16 @@ module ModerationAPI
4682
4868
  # @return [String, nil]
4683
4869
  required :channel_key, String, nil?: true
4684
4870
 
4871
+ # @!attribute client_action
4872
+ # A recommendation from your own client-side flagging.
4873
+ #
4874
+ # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction, nil]
4875
+ required :client_action,
4876
+ -> {
4877
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction
4878
+ },
4879
+ nil?: true
4880
+
4685
4881
  # @!attribute content
4686
4882
  # The original content payload
4687
4883
  #
@@ -4701,6 +4897,13 @@ module ModerationAPI
4701
4897
  # @return [Boolean, nil]
4702
4898
  required :flagged, ModerationAPI::Internal::Type::Boolean, nil?: true
4703
4899
 
4900
+ # @!attribute flagged_fields
4901
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
4902
+ # when no fields were flagged or the content is not an object.
4903
+ #
4904
+ # @return [Array<String>]
4905
+ required :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String]
4906
+
4704
4907
  # @!attribute labels
4705
4908
  # Moderation labels applied to the content
4706
4909
  #
@@ -4743,7 +4946,7 @@ module ModerationAPI
4743
4946
  # @return [Time]
4744
4947
  required :timestamp, Time
4745
4948
 
4746
- # @!method initialize(id:, author_id:, channel_key:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
4949
+ # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, flagged_fields:, labels:, language:, meta_type:, metadata:, timestamp:)
4747
4950
  # Some parameter documentations has been truncated, see
4748
4951
  # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item} for
4749
4952
  # more details.
@@ -4756,12 +4959,16 @@ module ModerationAPI
4756
4959
  #
4757
4960
  # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch
4758
4961
  #
4962
+ # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging.
4963
+ #
4759
4964
  # @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
4965
  #
4761
4966
  # @param conversation_id [String, nil] Conversation grouping ID, if any
4762
4967
  #
4763
4968
  # @param flagged [Boolean, nil] Whether the content was flagged by moderation
4764
4969
  #
4970
+ # @param flagged_fields [Array<String>] For object content, the field keys (e.g. "bio") that triggered a flag. Empty whe
4971
+ #
4765
4972
  # @param labels [Array<ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label>, nil] Moderation labels applied to the content
4766
4973
  #
4767
4974
  # @param language [String, nil] Detected ISO language code, if available
@@ -4772,6 +4979,79 @@ module ModerationAPI
4772
4979
  #
4773
4980
  # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted
4774
4981
 
4982
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item#client_action
4983
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
4984
+ # @!attribute action
4985
+ # Your recommendation for the content: allow, review, or reject.
4986
+ #
4987
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action]
4988
+ required :action,
4989
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action }
4990
+
4991
+ # @!attribute behavior
4992
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
4993
+ # applies it when stricter than ours; 'override' replaces ours outright.
4994
+ #
4995
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior, nil]
4996
+ optional :behavior,
4997
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior }
4998
+
4999
+ # @!attribute reason
5000
+ # A human-readable explanation for your recommendation.
5001
+ #
5002
+ # @return [String, nil]
5003
+ optional :reason, String
5004
+
5005
+ # @!attribute source
5006
+ # Where your recommendation came from, e.g. "banned-ip".
5007
+ #
5008
+ # @return [String, nil]
5009
+ optional :source, String
5010
+
5011
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
5012
+ # Some parameter documentations has been truncated, see
5013
+ # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction}
5014
+ # for more details.
5015
+ #
5016
+ # A recommendation from your own client-side flagging.
5017
+ #
5018
+ # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
5019
+ #
5020
+ # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
5021
+ #
5022
+ # @param reason [String] A human-readable explanation for your recommendation.
5023
+ #
5024
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
5025
+
5026
+ # Your recommendation for the content: allow, review, or reject.
5027
+ #
5028
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction#action
5029
+ module Action
5030
+ extend ModerationAPI::Internal::Type::Enum
5031
+
5032
+ REVIEW = :review
5033
+ ALLOW = :allow
5034
+ REJECT = :reject
5035
+
5036
+ # @!method self.values
5037
+ # @return [Array<Symbol>]
5038
+ end
5039
+
5040
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
5041
+ # applies it when stricter than ours; 'override' replaces ours outright.
5042
+ #
5043
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction#behavior
5044
+ module Behavior
5045
+ extend ModerationAPI::Internal::Type::Enum
5046
+
5047
+ OVERRIDE = :override
5048
+ ESCALATE = :escalate
5049
+
5050
+ # @!method self.values
5051
+ # @return [Array<Symbol>]
5052
+ end
5053
+ end
5054
+
4775
5055
  # The original content payload
4776
5056
  #
4777
5057
  # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item#content
@@ -5665,6 +5945,14 @@ module ModerationAPI
5665
5945
  # @return [String, nil]
5666
5946
  required :channel_key, String, nil?: true
5667
5947
 
5948
+ # @!attribute client_action
5949
+ # A recommendation from your own client-side flagging.
5950
+ #
5951
+ # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction, nil]
5952
+ required :client_action,
5953
+ -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction },
5954
+ nil?: true
5955
+
5668
5956
  # @!attribute content
5669
5957
  # The original content payload
5670
5958
  #
@@ -5684,6 +5972,13 @@ module ModerationAPI
5684
5972
  # @return [Boolean, nil]
5685
5973
  required :flagged, ModerationAPI::Internal::Type::Boolean, nil?: true
5686
5974
 
5975
+ # @!attribute flagged_fields
5976
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
5977
+ # when no fields were flagged or the content is not an object.
5978
+ #
5979
+ # @return [Array<String>]
5980
+ required :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String]
5981
+
5687
5982
  # @!attribute labels
5688
5983
  # Moderation labels applied to the content
5689
5984
  #
@@ -5726,7 +6021,7 @@ module ModerationAPI
5726
6021
  # @return [Time]
5727
6022
  required :timestamp, Time
5728
6023
 
5729
- # @!method initialize(id:, author_id:, channel_key:, content:, conversation_id:, flagged:, labels:, language:, meta_type:, metadata:, timestamp:)
6024
+ # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, flagged_fields:, labels:, language:, meta_type:, metadata:, timestamp:)
5730
6025
  # Some parameter documentations has been truncated, see
5731
6026
  # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item} for
5732
6027
  # more details.
@@ -5739,12 +6034,16 @@ module ModerationAPI
5739
6034
  #
5740
6035
  # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch
5741
6036
  #
6037
+ # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging.
6038
+ #
5742
6039
  # @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
6040
  #
5744
6041
  # @param conversation_id [String, nil] Conversation grouping ID, if any
5745
6042
  #
5746
6043
  # @param flagged [Boolean, nil] Whether the content was flagged by moderation
5747
6044
  #
6045
+ # @param flagged_fields [Array<String>] For object content, the field keys (e.g. "bio") that triggered a flag. Empty whe
6046
+ #
5748
6047
  # @param labels [Array<ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label>, nil] Moderation labels applied to the content
5749
6048
  #
5750
6049
  # @param language [String, nil] Detected ISO language code, if available
@@ -5755,6 +6054,79 @@ module ModerationAPI
5755
6054
  #
5756
6055
  # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted
5757
6056
 
6057
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item#client_action
6058
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
6059
+ # @!attribute action
6060
+ # Your recommendation for the content: allow, review, or reject.
6061
+ #
6062
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action]
6063
+ required :action,
6064
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action }
6065
+
6066
+ # @!attribute behavior
6067
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
6068
+ # applies it when stricter than ours; 'override' replaces ours outright.
6069
+ #
6070
+ # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior, nil]
6071
+ optional :behavior,
6072
+ enum: -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior }
6073
+
6074
+ # @!attribute reason
6075
+ # A human-readable explanation for your recommendation.
6076
+ #
6077
+ # @return [String, nil]
6078
+ optional :reason, String
6079
+
6080
+ # @!attribute source
6081
+ # Where your recommendation came from, e.g. "banned-ip".
6082
+ #
6083
+ # @return [String, nil]
6084
+ optional :source, String
6085
+
6086
+ # @!method initialize(action:, behavior: nil, reason: nil, source: nil)
6087
+ # Some parameter documentations has been truncated, see
6088
+ # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction}
6089
+ # for more details.
6090
+ #
6091
+ # A recommendation from your own client-side flagging.
6092
+ #
6093
+ # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
6094
+ #
6095
+ # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
6096
+ #
6097
+ # @param reason [String] A human-readable explanation for your recommendation.
6098
+ #
6099
+ # @param source [String] Where your recommendation came from, e.g. "banned-ip".
6100
+
6101
+ # Your recommendation for the content: allow, review, or reject.
6102
+ #
6103
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction#action
6104
+ module Action
6105
+ extend ModerationAPI::Internal::Type::Enum
6106
+
6107
+ REVIEW = :review
6108
+ ALLOW = :allow
6109
+ REJECT = :reject
6110
+
6111
+ # @!method self.values
6112
+ # @return [Array<Symbol>]
6113
+ end
6114
+
6115
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
6116
+ # applies it when stricter than ours; 'override' replaces ours outright.
6117
+ #
6118
+ # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction#behavior
6119
+ module Behavior
6120
+ extend ModerationAPI::Internal::Type::Enum
6121
+
6122
+ OVERRIDE = :override
6123
+ ESCALATE = :escalate
6124
+
6125
+ # @!method self.values
6126
+ # @return [Array<Symbol>]
6127
+ end
6128
+ end
6129
+
5758
6130
  # The original content payload
5759
6131
  #
5760
6132
  # @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.22.0"
5
5
  end