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.
@@ -4487,6 +4487,26 @@ module ModerationAPI
4487
4487
  sig { returns(T.nilable(String)) }
4488
4488
  attr_accessor :channel_key
4489
4489
 
4490
+ # A recommendation from your own client-side flagging.
4491
+ sig do
4492
+ returns(
4493
+ T.nilable(
4494
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction
4495
+ )
4496
+ )
4497
+ end
4498
+ attr_reader :client_action
4499
+
4500
+ sig do
4501
+ params(
4502
+ client_action:
4503
+ T.nilable(
4504
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::OrHash
4505
+ )
4506
+ ).void
4507
+ end
4508
+ attr_writer :client_action
4509
+
4490
4510
  # The original content payload
4491
4511
  sig do
4492
4512
  returns(
@@ -4509,6 +4529,11 @@ module ModerationAPI
4509
4529
  sig { returns(T.nilable(T::Boolean)) }
4510
4530
  attr_accessor :flagged
4511
4531
 
4532
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
4533
+ # when no fields were flagged or the content is not an object.
4534
+ sig { returns(T::Array[String]) }
4535
+ attr_accessor :flagged_fields
4536
+
4512
4537
  # Moderation labels applied to the content
4513
4538
  sig do
4514
4539
  returns(
@@ -4550,6 +4575,10 @@ module ModerationAPI
4550
4575
  id: String,
4551
4576
  author_id: T.nilable(String),
4552
4577
  channel_key: T.nilable(String),
4578
+ client_action:
4579
+ T.nilable(
4580
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::OrHash
4581
+ ),
4553
4582
  content:
4554
4583
  T.any(
4555
4584
  ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text::OrHash,
@@ -4560,6 +4589,7 @@ module ModerationAPI
4560
4589
  ),
4561
4590
  conversation_id: T.nilable(String),
4562
4591
  flagged: T.nilable(T::Boolean),
4592
+ flagged_fields: T::Array[String],
4563
4593
  labels:
4564
4594
  T.nilable(
4565
4595
  T::Array[
@@ -4583,12 +4613,17 @@ module ModerationAPI
4583
4613
  # The channel the content was submitted to, identified by your customer-defined
4584
4614
  # channel key.
4585
4615
  channel_key:,
4616
+ # A recommendation from your own client-side flagging.
4617
+ client_action:,
4586
4618
  # The original content payload
4587
4619
  content:,
4588
4620
  # Conversation grouping ID, if any
4589
4621
  conversation_id:,
4590
4622
  # Whether the content was flagged by moderation
4591
4623
  flagged:,
4624
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
4625
+ # when no fields were flagged or the content is not an object.
4626
+ flagged_fields:,
4592
4627
  # Moderation labels applied to the content
4593
4628
  labels:,
4594
4629
  # Detected ISO language code, if available
@@ -4610,6 +4645,10 @@ module ModerationAPI
4610
4645
  id: String,
4611
4646
  author_id: T.nilable(String),
4612
4647
  channel_key: T.nilable(String),
4648
+ client_action:
4649
+ T.nilable(
4650
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction
4651
+ ),
4613
4652
  content:
4614
4653
  T.any(
4615
4654
  ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text,
@@ -4620,6 +4659,7 @@ module ModerationAPI
4620
4659
  ),
4621
4660
  conversation_id: T.nilable(String),
4622
4661
  flagged: T.nilable(T::Boolean),
4662
+ flagged_fields: T::Array[String],
4623
4663
  labels:
4624
4664
  T.nilable(
4625
4665
  T::Array[
@@ -4639,6 +4679,172 @@ module ModerationAPI
4639
4679
  def to_hash
4640
4680
  end
4641
4681
 
4682
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
4683
+ OrHash =
4684
+ T.type_alias do
4685
+ T.any(
4686
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction,
4687
+ ModerationAPI::Internal::AnyHash
4688
+ )
4689
+ end
4690
+
4691
+ # Your recommendation for the content: allow, review, or reject.
4692
+ sig do
4693
+ returns(
4694
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol
4695
+ )
4696
+ end
4697
+ attr_accessor :action
4698
+
4699
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
4700
+ # applies it when stricter than ours; 'override' replaces ours outright.
4701
+ sig do
4702
+ returns(
4703
+ T.nilable(
4704
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol
4705
+ )
4706
+ )
4707
+ end
4708
+ attr_reader :behavior
4709
+
4710
+ sig do
4711
+ params(
4712
+ behavior:
4713
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol
4714
+ ).void
4715
+ end
4716
+ attr_writer :behavior
4717
+
4718
+ # A human-readable explanation for your recommendation.
4719
+ sig { returns(T.nilable(String)) }
4720
+ attr_reader :reason
4721
+
4722
+ sig { params(reason: String).void }
4723
+ attr_writer :reason
4724
+
4725
+ # Where your recommendation came from, e.g. "banned-ip".
4726
+ sig { returns(T.nilable(String)) }
4727
+ attr_reader :source
4728
+
4729
+ sig { params(source: String).void }
4730
+ attr_writer :source
4731
+
4732
+ # A recommendation from your own client-side flagging.
4733
+ sig do
4734
+ params(
4735
+ action:
4736
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol,
4737
+ behavior:
4738
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol,
4739
+ reason: String,
4740
+ source: String
4741
+ ).returns(T.attached_class)
4742
+ end
4743
+ def self.new(
4744
+ # Your recommendation for the content: allow, review, or reject.
4745
+ action:,
4746
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
4747
+ # applies it when stricter than ours; 'override' replaces ours outright.
4748
+ behavior: nil,
4749
+ # A human-readable explanation for your recommendation.
4750
+ reason: nil,
4751
+ # Where your recommendation came from, e.g. "banned-ip".
4752
+ source: nil
4753
+ )
4754
+ end
4755
+
4756
+ sig do
4757
+ override.returns(
4758
+ {
4759
+ action:
4760
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol,
4761
+ behavior:
4762
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol,
4763
+ reason: String,
4764
+ source: String
4765
+ }
4766
+ )
4767
+ end
4768
+ def to_hash
4769
+ end
4770
+
4771
+ # Your recommendation for the content: allow, review, or reject.
4772
+ module Action
4773
+ extend ModerationAPI::Internal::Type::Enum
4774
+
4775
+ TaggedSymbol =
4776
+ T.type_alias do
4777
+ T.all(
4778
+ Symbol,
4779
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action
4780
+ )
4781
+ end
4782
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4783
+
4784
+ REVIEW =
4785
+ T.let(
4786
+ :review,
4787
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol
4788
+ )
4789
+ ALLOW =
4790
+ T.let(
4791
+ :allow,
4792
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol
4793
+ )
4794
+ REJECT =
4795
+ T.let(
4796
+ :reject,
4797
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol
4798
+ )
4799
+
4800
+ sig do
4801
+ override.returns(
4802
+ T::Array[
4803
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol
4804
+ ]
4805
+ )
4806
+ end
4807
+ def self.values
4808
+ end
4809
+ end
4810
+
4811
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
4812
+ # applies it when stricter than ours; 'override' replaces ours outright.
4813
+ module Behavior
4814
+ extend ModerationAPI::Internal::Type::Enum
4815
+
4816
+ TaggedSymbol =
4817
+ T.type_alias do
4818
+ T.all(
4819
+ Symbol,
4820
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior
4821
+ )
4822
+ end
4823
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4824
+
4825
+ OVERRIDE =
4826
+ T.let(
4827
+ :override,
4828
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
4829
+ )
4830
+ ESCALATE =
4831
+ T.let(
4832
+ :escalate,
4833
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
4834
+ )
4835
+
4836
+ sig do
4837
+ override.returns(
4838
+ T::Array[
4839
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
4840
+ ]
4841
+ )
4842
+ end
4843
+ def self.values
4844
+ end
4845
+ end
4846
+ end
4847
+
4642
4848
  # The original content payload
4643
4849
  module Content
4644
4850
  extend ModerationAPI::Internal::Type::Union
@@ -6759,6 +6965,26 @@ module ModerationAPI
6759
6965
  sig { returns(T.nilable(String)) }
6760
6966
  attr_accessor :channel_key
6761
6967
 
6968
+ # A recommendation from your own client-side flagging.
6969
+ sig do
6970
+ returns(
6971
+ T.nilable(
6972
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction
6973
+ )
6974
+ )
6975
+ end
6976
+ attr_reader :client_action
6977
+
6978
+ sig do
6979
+ params(
6980
+ client_action:
6981
+ T.nilable(
6982
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::OrHash
6983
+ )
6984
+ ).void
6985
+ end
6986
+ attr_writer :client_action
6987
+
6762
6988
  # The original content payload
6763
6989
  sig do
6764
6990
  returns(
@@ -6781,6 +7007,11 @@ module ModerationAPI
6781
7007
  sig { returns(T.nilable(T::Boolean)) }
6782
7008
  attr_accessor :flagged
6783
7009
 
7010
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
7011
+ # when no fields were flagged or the content is not an object.
7012
+ sig { returns(T::Array[String]) }
7013
+ attr_accessor :flagged_fields
7014
+
6784
7015
  # Moderation labels applied to the content
6785
7016
  sig do
6786
7017
  returns(
@@ -6823,6 +7054,10 @@ module ModerationAPI
6823
7054
  id: String,
6824
7055
  author_id: T.nilable(String),
6825
7056
  channel_key: T.nilable(String),
7057
+ client_action:
7058
+ T.nilable(
7059
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::OrHash
7060
+ ),
6826
7061
  content:
6827
7062
  T.any(
6828
7063
  ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text::OrHash,
@@ -6833,6 +7068,7 @@ module ModerationAPI
6833
7068
  ),
6834
7069
  conversation_id: T.nilable(String),
6835
7070
  flagged: T.nilable(T::Boolean),
7071
+ flagged_fields: T::Array[String],
6836
7072
  labels:
6837
7073
  T.nilable(
6838
7074
  T::Array[
@@ -6856,12 +7092,17 @@ module ModerationAPI
6856
7092
  # The channel the content was submitted to, identified by your customer-defined
6857
7093
  # channel key.
6858
7094
  channel_key:,
7095
+ # A recommendation from your own client-side flagging.
7096
+ client_action:,
6859
7097
  # The original content payload
6860
7098
  content:,
6861
7099
  # Conversation grouping ID, if any
6862
7100
  conversation_id:,
6863
7101
  # Whether the content was flagged by moderation
6864
7102
  flagged:,
7103
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
7104
+ # when no fields were flagged or the content is not an object.
7105
+ flagged_fields:,
6865
7106
  # Moderation labels applied to the content
6866
7107
  labels:,
6867
7108
  # Detected ISO language code, if available
@@ -6883,6 +7124,10 @@ module ModerationAPI
6883
7124
  id: String,
6884
7125
  author_id: T.nilable(String),
6885
7126
  channel_key: T.nilable(String),
7127
+ client_action:
7128
+ T.nilable(
7129
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction
7130
+ ),
6886
7131
  content:
6887
7132
  T.any(
6888
7133
  ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text,
@@ -6893,6 +7138,7 @@ module ModerationAPI
6893
7138
  ),
6894
7139
  conversation_id: T.nilable(String),
6895
7140
  flagged: T.nilable(T::Boolean),
7141
+ flagged_fields: T::Array[String],
6896
7142
  labels:
6897
7143
  T.nilable(
6898
7144
  T::Array[
@@ -6912,6 +7158,172 @@ module ModerationAPI
6912
7158
  def to_hash
6913
7159
  end
6914
7160
 
7161
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
7162
+ OrHash =
7163
+ T.type_alias do
7164
+ T.any(
7165
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction,
7166
+ ModerationAPI::Internal::AnyHash
7167
+ )
7168
+ end
7169
+
7170
+ # Your recommendation for the content: allow, review, or reject.
7171
+ sig do
7172
+ returns(
7173
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol
7174
+ )
7175
+ end
7176
+ attr_accessor :action
7177
+
7178
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
7179
+ # applies it when stricter than ours; 'override' replaces ours outright.
7180
+ sig do
7181
+ returns(
7182
+ T.nilable(
7183
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol
7184
+ )
7185
+ )
7186
+ end
7187
+ attr_reader :behavior
7188
+
7189
+ sig do
7190
+ params(
7191
+ behavior:
7192
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol
7193
+ ).void
7194
+ end
7195
+ attr_writer :behavior
7196
+
7197
+ # A human-readable explanation for your recommendation.
7198
+ sig { returns(T.nilable(String)) }
7199
+ attr_reader :reason
7200
+
7201
+ sig { params(reason: String).void }
7202
+ attr_writer :reason
7203
+
7204
+ # Where your recommendation came from, e.g. "banned-ip".
7205
+ sig { returns(T.nilable(String)) }
7206
+ attr_reader :source
7207
+
7208
+ sig { params(source: String).void }
7209
+ attr_writer :source
7210
+
7211
+ # A recommendation from your own client-side flagging.
7212
+ sig do
7213
+ params(
7214
+ action:
7215
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol,
7216
+ behavior:
7217
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol,
7218
+ reason: String,
7219
+ source: String
7220
+ ).returns(T.attached_class)
7221
+ end
7222
+ def self.new(
7223
+ # Your recommendation for the content: allow, review, or reject.
7224
+ action:,
7225
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
7226
+ # applies it when stricter than ours; 'override' replaces ours outright.
7227
+ behavior: nil,
7228
+ # A human-readable explanation for your recommendation.
7229
+ reason: nil,
7230
+ # Where your recommendation came from, e.g. "banned-ip".
7231
+ source: nil
7232
+ )
7233
+ end
7234
+
7235
+ sig do
7236
+ override.returns(
7237
+ {
7238
+ action:
7239
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol,
7240
+ behavior:
7241
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol,
7242
+ reason: String,
7243
+ source: String
7244
+ }
7245
+ )
7246
+ end
7247
+ def to_hash
7248
+ end
7249
+
7250
+ # Your recommendation for the content: allow, review, or reject.
7251
+ module Action
7252
+ extend ModerationAPI::Internal::Type::Enum
7253
+
7254
+ TaggedSymbol =
7255
+ T.type_alias do
7256
+ T.all(
7257
+ Symbol,
7258
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action
7259
+ )
7260
+ end
7261
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7262
+
7263
+ REVIEW =
7264
+ T.let(
7265
+ :review,
7266
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol
7267
+ )
7268
+ ALLOW =
7269
+ T.let(
7270
+ :allow,
7271
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol
7272
+ )
7273
+ REJECT =
7274
+ T.let(
7275
+ :reject,
7276
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol
7277
+ )
7278
+
7279
+ sig do
7280
+ override.returns(
7281
+ T::Array[
7282
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol
7283
+ ]
7284
+ )
7285
+ end
7286
+ def self.values
7287
+ end
7288
+ end
7289
+
7290
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
7291
+ # applies it when stricter than ours; 'override' replaces ours outright.
7292
+ module Behavior
7293
+ extend ModerationAPI::Internal::Type::Enum
7294
+
7295
+ TaggedSymbol =
7296
+ T.type_alias do
7297
+ T.all(
7298
+ Symbol,
7299
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior
7300
+ )
7301
+ end
7302
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7303
+
7304
+ OVERRIDE =
7305
+ T.let(
7306
+ :override,
7307
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
7308
+ )
7309
+ ESCALATE =
7310
+ T.let(
7311
+ :escalate,
7312
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
7313
+ )
7314
+
7315
+ sig do
7316
+ override.returns(
7317
+ T::Array[
7318
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
7319
+ ]
7320
+ )
7321
+ end
7322
+ def self.values
7323
+ end
7324
+ end
7325
+ end
7326
+
6915
7327
  # The original content payload
6916
7328
  module Content
6917
7329
  extend ModerationAPI::Internal::Type::Union
@@ -8532,6 +8944,26 @@ module ModerationAPI
8532
8944
  sig { returns(T.nilable(String)) }
8533
8945
  attr_accessor :channel_key
8534
8946
 
8947
+ # A recommendation from your own client-side flagging.
8948
+ sig do
8949
+ returns(
8950
+ T.nilable(
8951
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction
8952
+ )
8953
+ )
8954
+ end
8955
+ attr_reader :client_action
8956
+
8957
+ sig do
8958
+ params(
8959
+ client_action:
8960
+ T.nilable(
8961
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::OrHash
8962
+ )
8963
+ ).void
8964
+ end
8965
+ attr_writer :client_action
8966
+
8535
8967
  # The original content payload
8536
8968
  sig do
8537
8969
  returns(
@@ -8554,6 +8986,11 @@ module ModerationAPI
8554
8986
  sig { returns(T.nilable(T::Boolean)) }
8555
8987
  attr_accessor :flagged
8556
8988
 
8989
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
8990
+ # when no fields were flagged or the content is not an object.
8991
+ sig { returns(T::Array[String]) }
8992
+ attr_accessor :flagged_fields
8993
+
8557
8994
  # Moderation labels applied to the content
8558
8995
  sig do
8559
8996
  returns(
@@ -8596,6 +9033,10 @@ module ModerationAPI
8596
9033
  id: String,
8597
9034
  author_id: T.nilable(String),
8598
9035
  channel_key: T.nilable(String),
9036
+ client_action:
9037
+ T.nilable(
9038
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::OrHash
9039
+ ),
8599
9040
  content:
8600
9041
  T.any(
8601
9042
  ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text::OrHash,
@@ -8606,6 +9047,7 @@ module ModerationAPI
8606
9047
  ),
8607
9048
  conversation_id: T.nilable(String),
8608
9049
  flagged: T.nilable(T::Boolean),
9050
+ flagged_fields: T::Array[String],
8609
9051
  labels:
8610
9052
  T.nilable(
8611
9053
  T::Array[
@@ -8629,12 +9071,17 @@ module ModerationAPI
8629
9071
  # The channel the content was submitted to, identified by your customer-defined
8630
9072
  # channel key.
8631
9073
  channel_key:,
9074
+ # A recommendation from your own client-side flagging.
9075
+ client_action:,
8632
9076
  # The original content payload
8633
9077
  content:,
8634
9078
  # Conversation grouping ID, if any
8635
9079
  conversation_id:,
8636
9080
  # Whether the content was flagged by moderation
8637
9081
  flagged:,
9082
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
9083
+ # when no fields were flagged or the content is not an object.
9084
+ flagged_fields:,
8638
9085
  # Moderation labels applied to the content
8639
9086
  labels:,
8640
9087
  # Detected ISO language code, if available
@@ -8656,6 +9103,10 @@ module ModerationAPI
8656
9103
  id: String,
8657
9104
  author_id: T.nilable(String),
8658
9105
  channel_key: T.nilable(String),
9106
+ client_action:
9107
+ T.nilable(
9108
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction
9109
+ ),
8659
9110
  content:
8660
9111
  T.any(
8661
9112
  ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text,
@@ -8666,6 +9117,7 @@ module ModerationAPI
8666
9117
  ),
8667
9118
  conversation_id: T.nilable(String),
8668
9119
  flagged: T.nilable(T::Boolean),
9120
+ flagged_fields: T::Array[String],
8669
9121
  labels:
8670
9122
  T.nilable(
8671
9123
  T::Array[
@@ -8685,6 +9137,172 @@ module ModerationAPI
8685
9137
  def to_hash
8686
9138
  end
8687
9139
 
9140
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
9141
+ OrHash =
9142
+ T.type_alias do
9143
+ T.any(
9144
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction,
9145
+ ModerationAPI::Internal::AnyHash
9146
+ )
9147
+ end
9148
+
9149
+ # Your recommendation for the content: allow, review, or reject.
9150
+ sig do
9151
+ returns(
9152
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol
9153
+ )
9154
+ end
9155
+ attr_accessor :action
9156
+
9157
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
9158
+ # applies it when stricter than ours; 'override' replaces ours outright.
9159
+ sig do
9160
+ returns(
9161
+ T.nilable(
9162
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol
9163
+ )
9164
+ )
9165
+ end
9166
+ attr_reader :behavior
9167
+
9168
+ sig do
9169
+ params(
9170
+ behavior:
9171
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol
9172
+ ).void
9173
+ end
9174
+ attr_writer :behavior
9175
+
9176
+ # A human-readable explanation for your recommendation.
9177
+ sig { returns(T.nilable(String)) }
9178
+ attr_reader :reason
9179
+
9180
+ sig { params(reason: String).void }
9181
+ attr_writer :reason
9182
+
9183
+ # Where your recommendation came from, e.g. "banned-ip".
9184
+ sig { returns(T.nilable(String)) }
9185
+ attr_reader :source
9186
+
9187
+ sig { params(source: String).void }
9188
+ attr_writer :source
9189
+
9190
+ # A recommendation from your own client-side flagging.
9191
+ sig do
9192
+ params(
9193
+ action:
9194
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol,
9195
+ behavior:
9196
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol,
9197
+ reason: String,
9198
+ source: String
9199
+ ).returns(T.attached_class)
9200
+ end
9201
+ def self.new(
9202
+ # Your recommendation for the content: allow, review, or reject.
9203
+ action:,
9204
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
9205
+ # applies it when stricter than ours; 'override' replaces ours outright.
9206
+ behavior: nil,
9207
+ # A human-readable explanation for your recommendation.
9208
+ reason: nil,
9209
+ # Where your recommendation came from, e.g. "banned-ip".
9210
+ source: nil
9211
+ )
9212
+ end
9213
+
9214
+ sig do
9215
+ override.returns(
9216
+ {
9217
+ action:
9218
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol,
9219
+ behavior:
9220
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol,
9221
+ reason: String,
9222
+ source: String
9223
+ }
9224
+ )
9225
+ end
9226
+ def to_hash
9227
+ end
9228
+
9229
+ # Your recommendation for the content: allow, review, or reject.
9230
+ module Action
9231
+ extend ModerationAPI::Internal::Type::Enum
9232
+
9233
+ TaggedSymbol =
9234
+ T.type_alias do
9235
+ T.all(
9236
+ Symbol,
9237
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action
9238
+ )
9239
+ end
9240
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
9241
+
9242
+ REVIEW =
9243
+ T.let(
9244
+ :review,
9245
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol
9246
+ )
9247
+ ALLOW =
9248
+ T.let(
9249
+ :allow,
9250
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol
9251
+ )
9252
+ REJECT =
9253
+ T.let(
9254
+ :reject,
9255
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol
9256
+ )
9257
+
9258
+ sig do
9259
+ override.returns(
9260
+ T::Array[
9261
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol
9262
+ ]
9263
+ )
9264
+ end
9265
+ def self.values
9266
+ end
9267
+ end
9268
+
9269
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
9270
+ # applies it when stricter than ours; 'override' replaces ours outright.
9271
+ module Behavior
9272
+ extend ModerationAPI::Internal::Type::Enum
9273
+
9274
+ TaggedSymbol =
9275
+ T.type_alias do
9276
+ T.all(
9277
+ Symbol,
9278
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior
9279
+ )
9280
+ end
9281
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
9282
+
9283
+ OVERRIDE =
9284
+ T.let(
9285
+ :override,
9286
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
9287
+ )
9288
+ ESCALATE =
9289
+ T.let(
9290
+ :escalate,
9291
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
9292
+ )
9293
+
9294
+ sig do
9295
+ override.returns(
9296
+ T::Array[
9297
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
9298
+ ]
9299
+ )
9300
+ end
9301
+ def self.values
9302
+ end
9303
+ end
9304
+ end
9305
+
8688
9306
  # The original content payload
8689
9307
  module Content
8690
9308
  extend ModerationAPI::Internal::Type::Union
@@ -10303,6 +10921,26 @@ module ModerationAPI
10303
10921
  sig { returns(T.nilable(String)) }
10304
10922
  attr_accessor :channel_key
10305
10923
 
10924
+ # A recommendation from your own client-side flagging.
10925
+ sig do
10926
+ returns(
10927
+ T.nilable(
10928
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction
10929
+ )
10930
+ )
10931
+ end
10932
+ attr_reader :client_action
10933
+
10934
+ sig do
10935
+ params(
10936
+ client_action:
10937
+ T.nilable(
10938
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::OrHash
10939
+ )
10940
+ ).void
10941
+ end
10942
+ attr_writer :client_action
10943
+
10306
10944
  # The original content payload
10307
10945
  sig do
10308
10946
  returns(
@@ -10325,6 +10963,11 @@ module ModerationAPI
10325
10963
  sig { returns(T.nilable(T::Boolean)) }
10326
10964
  attr_accessor :flagged
10327
10965
 
10966
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
10967
+ # when no fields were flagged or the content is not an object.
10968
+ sig { returns(T::Array[String]) }
10969
+ attr_accessor :flagged_fields
10970
+
10328
10971
  # Moderation labels applied to the content
10329
10972
  sig do
10330
10973
  returns(
@@ -10367,6 +11010,10 @@ module ModerationAPI
10367
11010
  id: String,
10368
11011
  author_id: T.nilable(String),
10369
11012
  channel_key: T.nilable(String),
11013
+ client_action:
11014
+ T.nilable(
11015
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::OrHash
11016
+ ),
10370
11017
  content:
10371
11018
  T.any(
10372
11019
  ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text::OrHash,
@@ -10377,6 +11024,7 @@ module ModerationAPI
10377
11024
  ),
10378
11025
  conversation_id: T.nilable(String),
10379
11026
  flagged: T.nilable(T::Boolean),
11027
+ flagged_fields: T::Array[String],
10380
11028
  labels:
10381
11029
  T.nilable(
10382
11030
  T::Array[
@@ -10400,12 +11048,17 @@ module ModerationAPI
10400
11048
  # The channel the content was submitted to, identified by your customer-defined
10401
11049
  # channel key.
10402
11050
  channel_key:,
11051
+ # A recommendation from your own client-side flagging.
11052
+ client_action:,
10403
11053
  # The original content payload
10404
11054
  content:,
10405
11055
  # Conversation grouping ID, if any
10406
11056
  conversation_id:,
10407
11057
  # Whether the content was flagged by moderation
10408
11058
  flagged:,
11059
+ # For object content, the field keys (e.g. "bio") that triggered a flag. Empty
11060
+ # when no fields were flagged or the content is not an object.
11061
+ flagged_fields:,
10409
11062
  # Moderation labels applied to the content
10410
11063
  labels:,
10411
11064
  # Detected ISO language code, if available
@@ -10427,6 +11080,10 @@ module ModerationAPI
10427
11080
  id: String,
10428
11081
  author_id: T.nilable(String),
10429
11082
  channel_key: T.nilable(String),
11083
+ client_action:
11084
+ T.nilable(
11085
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction
11086
+ ),
10430
11087
  content:
10431
11088
  T.any(
10432
11089
  ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text,
@@ -10437,6 +11094,7 @@ module ModerationAPI
10437
11094
  ),
10438
11095
  conversation_id: T.nilable(String),
10439
11096
  flagged: T.nilable(T::Boolean),
11097
+ flagged_fields: T::Array[String],
10440
11098
  labels:
10441
11099
  T.nilable(
10442
11100
  T::Array[
@@ -10456,6 +11114,172 @@ module ModerationAPI
10456
11114
  def to_hash
10457
11115
  end
10458
11116
 
11117
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
11118
+ OrHash =
11119
+ T.type_alias do
11120
+ T.any(
11121
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction,
11122
+ ModerationAPI::Internal::AnyHash
11123
+ )
11124
+ end
11125
+
11126
+ # Your recommendation for the content: allow, review, or reject.
11127
+ sig do
11128
+ returns(
11129
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol
11130
+ )
11131
+ end
11132
+ attr_accessor :action
11133
+
11134
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
11135
+ # applies it when stricter than ours; 'override' replaces ours outright.
11136
+ sig do
11137
+ returns(
11138
+ T.nilable(
11139
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol
11140
+ )
11141
+ )
11142
+ end
11143
+ attr_reader :behavior
11144
+
11145
+ sig do
11146
+ params(
11147
+ behavior:
11148
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol
11149
+ ).void
11150
+ end
11151
+ attr_writer :behavior
11152
+
11153
+ # A human-readable explanation for your recommendation.
11154
+ sig { returns(T.nilable(String)) }
11155
+ attr_reader :reason
11156
+
11157
+ sig { params(reason: String).void }
11158
+ attr_writer :reason
11159
+
11160
+ # Where your recommendation came from, e.g. "banned-ip".
11161
+ sig { returns(T.nilable(String)) }
11162
+ attr_reader :source
11163
+
11164
+ sig { params(source: String).void }
11165
+ attr_writer :source
11166
+
11167
+ # A recommendation from your own client-side flagging.
11168
+ sig do
11169
+ params(
11170
+ action:
11171
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol,
11172
+ behavior:
11173
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol,
11174
+ reason: String,
11175
+ source: String
11176
+ ).returns(T.attached_class)
11177
+ end
11178
+ def self.new(
11179
+ # Your recommendation for the content: allow, review, or reject.
11180
+ action:,
11181
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
11182
+ # applies it when stricter than ours; 'override' replaces ours outright.
11183
+ behavior: nil,
11184
+ # A human-readable explanation for your recommendation.
11185
+ reason: nil,
11186
+ # Where your recommendation came from, e.g. "banned-ip".
11187
+ source: nil
11188
+ )
11189
+ end
11190
+
11191
+ sig do
11192
+ override.returns(
11193
+ {
11194
+ action:
11195
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol,
11196
+ behavior:
11197
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol,
11198
+ reason: String,
11199
+ source: String
11200
+ }
11201
+ )
11202
+ end
11203
+ def to_hash
11204
+ end
11205
+
11206
+ # Your recommendation for the content: allow, review, or reject.
11207
+ module Action
11208
+ extend ModerationAPI::Internal::Type::Enum
11209
+
11210
+ TaggedSymbol =
11211
+ T.type_alias do
11212
+ T.all(
11213
+ Symbol,
11214
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action
11215
+ )
11216
+ end
11217
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11218
+
11219
+ REVIEW =
11220
+ T.let(
11221
+ :review,
11222
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol
11223
+ )
11224
+ ALLOW =
11225
+ T.let(
11226
+ :allow,
11227
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol
11228
+ )
11229
+ REJECT =
11230
+ T.let(
11231
+ :reject,
11232
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol
11233
+ )
11234
+
11235
+ sig do
11236
+ override.returns(
11237
+ T::Array[
11238
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol
11239
+ ]
11240
+ )
11241
+ end
11242
+ def self.values
11243
+ end
11244
+ end
11245
+
11246
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
11247
+ # applies it when stricter than ours; 'override' replaces ours outright.
11248
+ module Behavior
11249
+ extend ModerationAPI::Internal::Type::Enum
11250
+
11251
+ TaggedSymbol =
11252
+ T.type_alias do
11253
+ T.all(
11254
+ Symbol,
11255
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior
11256
+ )
11257
+ end
11258
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11259
+
11260
+ OVERRIDE =
11261
+ T.let(
11262
+ :override,
11263
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
11264
+ )
11265
+ ESCALATE =
11266
+ T.let(
11267
+ :escalate,
11268
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
11269
+ )
11270
+
11271
+ sig do
11272
+ override.returns(
11273
+ T::Array[
11274
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
11275
+ ]
11276
+ )
11277
+ end
11278
+ def self.values
11279
+ end
11280
+ end
11281
+ end
11282
+
10459
11283
  # The original content payload
10460
11284
  module Content
10461
11285
  extend ModerationAPI::Internal::Type::Union