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.
@@ -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(
@@ -4550,6 +4570,10 @@ module ModerationAPI
4550
4570
  id: String,
4551
4571
  author_id: T.nilable(String),
4552
4572
  channel_key: T.nilable(String),
4573
+ client_action:
4574
+ T.nilable(
4575
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::OrHash
4576
+ ),
4553
4577
  content:
4554
4578
  T.any(
4555
4579
  ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text::OrHash,
@@ -4583,6 +4607,8 @@ module ModerationAPI
4583
4607
  # The channel the content was submitted to, identified by your customer-defined
4584
4608
  # channel key.
4585
4609
  channel_key:,
4610
+ # A recommendation from your own client-side flagging.
4611
+ client_action:,
4586
4612
  # The original content payload
4587
4613
  content:,
4588
4614
  # Conversation grouping ID, if any
@@ -4610,6 +4636,10 @@ module ModerationAPI
4610
4636
  id: String,
4611
4637
  author_id: T.nilable(String),
4612
4638
  channel_key: T.nilable(String),
4639
+ client_action:
4640
+ T.nilable(
4641
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction
4642
+ ),
4613
4643
  content:
4614
4644
  T.any(
4615
4645
  ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text,
@@ -4639,6 +4669,172 @@ module ModerationAPI
4639
4669
  def to_hash
4640
4670
  end
4641
4671
 
4672
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
4673
+ OrHash =
4674
+ T.type_alias do
4675
+ T.any(
4676
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction,
4677
+ ModerationAPI::Internal::AnyHash
4678
+ )
4679
+ end
4680
+
4681
+ # Your recommendation for the content: allow, review, or reject.
4682
+ sig do
4683
+ returns(
4684
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol
4685
+ )
4686
+ end
4687
+ attr_accessor :action
4688
+
4689
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
4690
+ # applies it when stricter than ours; 'override' replaces ours outright.
4691
+ sig do
4692
+ returns(
4693
+ T.nilable(
4694
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol
4695
+ )
4696
+ )
4697
+ end
4698
+ attr_reader :behavior
4699
+
4700
+ sig do
4701
+ params(
4702
+ behavior:
4703
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol
4704
+ ).void
4705
+ end
4706
+ attr_writer :behavior
4707
+
4708
+ # A human-readable explanation for your recommendation.
4709
+ sig { returns(T.nilable(String)) }
4710
+ attr_reader :reason
4711
+
4712
+ sig { params(reason: String).void }
4713
+ attr_writer :reason
4714
+
4715
+ # Where your recommendation came from, e.g. "banned-ip".
4716
+ sig { returns(T.nilable(String)) }
4717
+ attr_reader :source
4718
+
4719
+ sig { params(source: String).void }
4720
+ attr_writer :source
4721
+
4722
+ # A recommendation from your own client-side flagging.
4723
+ sig do
4724
+ params(
4725
+ action:
4726
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol,
4727
+ behavior:
4728
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol,
4729
+ reason: String,
4730
+ source: String
4731
+ ).returns(T.attached_class)
4732
+ end
4733
+ def self.new(
4734
+ # Your recommendation for the content: allow, review, or reject.
4735
+ action:,
4736
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
4737
+ # applies it when stricter than ours; 'override' replaces ours outright.
4738
+ behavior: nil,
4739
+ # A human-readable explanation for your recommendation.
4740
+ reason: nil,
4741
+ # Where your recommendation came from, e.g. "banned-ip".
4742
+ source: nil
4743
+ )
4744
+ end
4745
+
4746
+ sig do
4747
+ override.returns(
4748
+ {
4749
+ action:
4750
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol,
4751
+ behavior:
4752
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol,
4753
+ reason: String,
4754
+ source: String
4755
+ }
4756
+ )
4757
+ end
4758
+ def to_hash
4759
+ end
4760
+
4761
+ # Your recommendation for the content: allow, review, or reject.
4762
+ module Action
4763
+ extend ModerationAPI::Internal::Type::Enum
4764
+
4765
+ TaggedSymbol =
4766
+ T.type_alias do
4767
+ T.all(
4768
+ Symbol,
4769
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action
4770
+ )
4771
+ end
4772
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4773
+
4774
+ REVIEW =
4775
+ T.let(
4776
+ :review,
4777
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol
4778
+ )
4779
+ ALLOW =
4780
+ T.let(
4781
+ :allow,
4782
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol
4783
+ )
4784
+ REJECT =
4785
+ T.let(
4786
+ :reject,
4787
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol
4788
+ )
4789
+
4790
+ sig do
4791
+ override.returns(
4792
+ T::Array[
4793
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol
4794
+ ]
4795
+ )
4796
+ end
4797
+ def self.values
4798
+ end
4799
+ end
4800
+
4801
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
4802
+ # applies it when stricter than ours; 'override' replaces ours outright.
4803
+ module Behavior
4804
+ extend ModerationAPI::Internal::Type::Enum
4805
+
4806
+ TaggedSymbol =
4807
+ T.type_alias do
4808
+ T.all(
4809
+ Symbol,
4810
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior
4811
+ )
4812
+ end
4813
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4814
+
4815
+ OVERRIDE =
4816
+ T.let(
4817
+ :override,
4818
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
4819
+ )
4820
+ ESCALATE =
4821
+ T.let(
4822
+ :escalate,
4823
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
4824
+ )
4825
+
4826
+ sig do
4827
+ override.returns(
4828
+ T::Array[
4829
+ ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
4830
+ ]
4831
+ )
4832
+ end
4833
+ def self.values
4834
+ end
4835
+ end
4836
+ end
4837
+
4642
4838
  # The original content payload
4643
4839
  module Content
4644
4840
  extend ModerationAPI::Internal::Type::Union
@@ -6759,6 +6955,26 @@ module ModerationAPI
6759
6955
  sig { returns(T.nilable(String)) }
6760
6956
  attr_accessor :channel_key
6761
6957
 
6958
+ # A recommendation from your own client-side flagging.
6959
+ sig do
6960
+ returns(
6961
+ T.nilable(
6962
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction
6963
+ )
6964
+ )
6965
+ end
6966
+ attr_reader :client_action
6967
+
6968
+ sig do
6969
+ params(
6970
+ client_action:
6971
+ T.nilable(
6972
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::OrHash
6973
+ )
6974
+ ).void
6975
+ end
6976
+ attr_writer :client_action
6977
+
6762
6978
  # The original content payload
6763
6979
  sig do
6764
6980
  returns(
@@ -6823,6 +7039,10 @@ module ModerationAPI
6823
7039
  id: String,
6824
7040
  author_id: T.nilable(String),
6825
7041
  channel_key: T.nilable(String),
7042
+ client_action:
7043
+ T.nilable(
7044
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::OrHash
7045
+ ),
6826
7046
  content:
6827
7047
  T.any(
6828
7048
  ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text::OrHash,
@@ -6856,6 +7076,8 @@ module ModerationAPI
6856
7076
  # The channel the content was submitted to, identified by your customer-defined
6857
7077
  # channel key.
6858
7078
  channel_key:,
7079
+ # A recommendation from your own client-side flagging.
7080
+ client_action:,
6859
7081
  # The original content payload
6860
7082
  content:,
6861
7083
  # Conversation grouping ID, if any
@@ -6883,6 +7105,10 @@ module ModerationAPI
6883
7105
  id: String,
6884
7106
  author_id: T.nilable(String),
6885
7107
  channel_key: T.nilable(String),
7108
+ client_action:
7109
+ T.nilable(
7110
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction
7111
+ ),
6886
7112
  content:
6887
7113
  T.any(
6888
7114
  ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text,
@@ -6912,6 +7138,172 @@ module ModerationAPI
6912
7138
  def to_hash
6913
7139
  end
6914
7140
 
7141
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
7142
+ OrHash =
7143
+ T.type_alias do
7144
+ T.any(
7145
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction,
7146
+ ModerationAPI::Internal::AnyHash
7147
+ )
7148
+ end
7149
+
7150
+ # Your recommendation for the content: allow, review, or reject.
7151
+ sig do
7152
+ returns(
7153
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol
7154
+ )
7155
+ end
7156
+ attr_accessor :action
7157
+
7158
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
7159
+ # applies it when stricter than ours; 'override' replaces ours outright.
7160
+ sig do
7161
+ returns(
7162
+ T.nilable(
7163
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol
7164
+ )
7165
+ )
7166
+ end
7167
+ attr_reader :behavior
7168
+
7169
+ sig do
7170
+ params(
7171
+ behavior:
7172
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol
7173
+ ).void
7174
+ end
7175
+ attr_writer :behavior
7176
+
7177
+ # A human-readable explanation for your recommendation.
7178
+ sig { returns(T.nilable(String)) }
7179
+ attr_reader :reason
7180
+
7181
+ sig { params(reason: String).void }
7182
+ attr_writer :reason
7183
+
7184
+ # Where your recommendation came from, e.g. "banned-ip".
7185
+ sig { returns(T.nilable(String)) }
7186
+ attr_reader :source
7187
+
7188
+ sig { params(source: String).void }
7189
+ attr_writer :source
7190
+
7191
+ # A recommendation from your own client-side flagging.
7192
+ sig do
7193
+ params(
7194
+ action:
7195
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol,
7196
+ behavior:
7197
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol,
7198
+ reason: String,
7199
+ source: String
7200
+ ).returns(T.attached_class)
7201
+ end
7202
+ def self.new(
7203
+ # Your recommendation for the content: allow, review, or reject.
7204
+ action:,
7205
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
7206
+ # applies it when stricter than ours; 'override' replaces ours outright.
7207
+ behavior: nil,
7208
+ # A human-readable explanation for your recommendation.
7209
+ reason: nil,
7210
+ # Where your recommendation came from, e.g. "banned-ip".
7211
+ source: nil
7212
+ )
7213
+ end
7214
+
7215
+ sig do
7216
+ override.returns(
7217
+ {
7218
+ action:
7219
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol,
7220
+ behavior:
7221
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol,
7222
+ reason: String,
7223
+ source: String
7224
+ }
7225
+ )
7226
+ end
7227
+ def to_hash
7228
+ end
7229
+
7230
+ # Your recommendation for the content: allow, review, or reject.
7231
+ module Action
7232
+ extend ModerationAPI::Internal::Type::Enum
7233
+
7234
+ TaggedSymbol =
7235
+ T.type_alias do
7236
+ T.all(
7237
+ Symbol,
7238
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action
7239
+ )
7240
+ end
7241
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7242
+
7243
+ REVIEW =
7244
+ T.let(
7245
+ :review,
7246
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol
7247
+ )
7248
+ ALLOW =
7249
+ T.let(
7250
+ :allow,
7251
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol
7252
+ )
7253
+ REJECT =
7254
+ T.let(
7255
+ :reject,
7256
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol
7257
+ )
7258
+
7259
+ sig do
7260
+ override.returns(
7261
+ T::Array[
7262
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol
7263
+ ]
7264
+ )
7265
+ end
7266
+ def self.values
7267
+ end
7268
+ end
7269
+
7270
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
7271
+ # applies it when stricter than ours; 'override' replaces ours outright.
7272
+ module Behavior
7273
+ extend ModerationAPI::Internal::Type::Enum
7274
+
7275
+ TaggedSymbol =
7276
+ T.type_alias do
7277
+ T.all(
7278
+ Symbol,
7279
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior
7280
+ )
7281
+ end
7282
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
7283
+
7284
+ OVERRIDE =
7285
+ T.let(
7286
+ :override,
7287
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
7288
+ )
7289
+ ESCALATE =
7290
+ T.let(
7291
+ :escalate,
7292
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
7293
+ )
7294
+
7295
+ sig do
7296
+ override.returns(
7297
+ T::Array[
7298
+ ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
7299
+ ]
7300
+ )
7301
+ end
7302
+ def self.values
7303
+ end
7304
+ end
7305
+ end
7306
+
6915
7307
  # The original content payload
6916
7308
  module Content
6917
7309
  extend ModerationAPI::Internal::Type::Union
@@ -8532,6 +8924,26 @@ module ModerationAPI
8532
8924
  sig { returns(T.nilable(String)) }
8533
8925
  attr_accessor :channel_key
8534
8926
 
8927
+ # A recommendation from your own client-side flagging.
8928
+ sig do
8929
+ returns(
8930
+ T.nilable(
8931
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction
8932
+ )
8933
+ )
8934
+ end
8935
+ attr_reader :client_action
8936
+
8937
+ sig do
8938
+ params(
8939
+ client_action:
8940
+ T.nilable(
8941
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::OrHash
8942
+ )
8943
+ ).void
8944
+ end
8945
+ attr_writer :client_action
8946
+
8535
8947
  # The original content payload
8536
8948
  sig do
8537
8949
  returns(
@@ -8596,6 +9008,10 @@ module ModerationAPI
8596
9008
  id: String,
8597
9009
  author_id: T.nilable(String),
8598
9010
  channel_key: T.nilable(String),
9011
+ client_action:
9012
+ T.nilable(
9013
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::OrHash
9014
+ ),
8599
9015
  content:
8600
9016
  T.any(
8601
9017
  ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text::OrHash,
@@ -8629,6 +9045,8 @@ module ModerationAPI
8629
9045
  # The channel the content was submitted to, identified by your customer-defined
8630
9046
  # channel key.
8631
9047
  channel_key:,
9048
+ # A recommendation from your own client-side flagging.
9049
+ client_action:,
8632
9050
  # The original content payload
8633
9051
  content:,
8634
9052
  # Conversation grouping ID, if any
@@ -8656,6 +9074,10 @@ module ModerationAPI
8656
9074
  id: String,
8657
9075
  author_id: T.nilable(String),
8658
9076
  channel_key: T.nilable(String),
9077
+ client_action:
9078
+ T.nilable(
9079
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction
9080
+ ),
8659
9081
  content:
8660
9082
  T.any(
8661
9083
  ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text,
@@ -8685,6 +9107,172 @@ module ModerationAPI
8685
9107
  def to_hash
8686
9108
  end
8687
9109
 
9110
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
9111
+ OrHash =
9112
+ T.type_alias do
9113
+ T.any(
9114
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction,
9115
+ ModerationAPI::Internal::AnyHash
9116
+ )
9117
+ end
9118
+
9119
+ # Your recommendation for the content: allow, review, or reject.
9120
+ sig do
9121
+ returns(
9122
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol
9123
+ )
9124
+ end
9125
+ attr_accessor :action
9126
+
9127
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
9128
+ # applies it when stricter than ours; 'override' replaces ours outright.
9129
+ sig do
9130
+ returns(
9131
+ T.nilable(
9132
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol
9133
+ )
9134
+ )
9135
+ end
9136
+ attr_reader :behavior
9137
+
9138
+ sig do
9139
+ params(
9140
+ behavior:
9141
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol
9142
+ ).void
9143
+ end
9144
+ attr_writer :behavior
9145
+
9146
+ # A human-readable explanation for your recommendation.
9147
+ sig { returns(T.nilable(String)) }
9148
+ attr_reader :reason
9149
+
9150
+ sig { params(reason: String).void }
9151
+ attr_writer :reason
9152
+
9153
+ # Where your recommendation came from, e.g. "banned-ip".
9154
+ sig { returns(T.nilable(String)) }
9155
+ attr_reader :source
9156
+
9157
+ sig { params(source: String).void }
9158
+ attr_writer :source
9159
+
9160
+ # A recommendation from your own client-side flagging.
9161
+ sig do
9162
+ params(
9163
+ action:
9164
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol,
9165
+ behavior:
9166
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol,
9167
+ reason: String,
9168
+ source: String
9169
+ ).returns(T.attached_class)
9170
+ end
9171
+ def self.new(
9172
+ # Your recommendation for the content: allow, review, or reject.
9173
+ action:,
9174
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
9175
+ # applies it when stricter than ours; 'override' replaces ours outright.
9176
+ behavior: nil,
9177
+ # A human-readable explanation for your recommendation.
9178
+ reason: nil,
9179
+ # Where your recommendation came from, e.g. "banned-ip".
9180
+ source: nil
9181
+ )
9182
+ end
9183
+
9184
+ sig do
9185
+ override.returns(
9186
+ {
9187
+ action:
9188
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol,
9189
+ behavior:
9190
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol,
9191
+ reason: String,
9192
+ source: String
9193
+ }
9194
+ )
9195
+ end
9196
+ def to_hash
9197
+ end
9198
+
9199
+ # Your recommendation for the content: allow, review, or reject.
9200
+ module Action
9201
+ extend ModerationAPI::Internal::Type::Enum
9202
+
9203
+ TaggedSymbol =
9204
+ T.type_alias do
9205
+ T.all(
9206
+ Symbol,
9207
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action
9208
+ )
9209
+ end
9210
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
9211
+
9212
+ REVIEW =
9213
+ T.let(
9214
+ :review,
9215
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol
9216
+ )
9217
+ ALLOW =
9218
+ T.let(
9219
+ :allow,
9220
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol
9221
+ )
9222
+ REJECT =
9223
+ T.let(
9224
+ :reject,
9225
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol
9226
+ )
9227
+
9228
+ sig do
9229
+ override.returns(
9230
+ T::Array[
9231
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol
9232
+ ]
9233
+ )
9234
+ end
9235
+ def self.values
9236
+ end
9237
+ end
9238
+
9239
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
9240
+ # applies it when stricter than ours; 'override' replaces ours outright.
9241
+ module Behavior
9242
+ extend ModerationAPI::Internal::Type::Enum
9243
+
9244
+ TaggedSymbol =
9245
+ T.type_alias do
9246
+ T.all(
9247
+ Symbol,
9248
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior
9249
+ )
9250
+ end
9251
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
9252
+
9253
+ OVERRIDE =
9254
+ T.let(
9255
+ :override,
9256
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
9257
+ )
9258
+ ESCALATE =
9259
+ T.let(
9260
+ :escalate,
9261
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
9262
+ )
9263
+
9264
+ sig do
9265
+ override.returns(
9266
+ T::Array[
9267
+ ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
9268
+ ]
9269
+ )
9270
+ end
9271
+ def self.values
9272
+ end
9273
+ end
9274
+ end
9275
+
8688
9276
  # The original content payload
8689
9277
  module Content
8690
9278
  extend ModerationAPI::Internal::Type::Union
@@ -10303,6 +10891,26 @@ module ModerationAPI
10303
10891
  sig { returns(T.nilable(String)) }
10304
10892
  attr_accessor :channel_key
10305
10893
 
10894
+ # A recommendation from your own client-side flagging.
10895
+ sig do
10896
+ returns(
10897
+ T.nilable(
10898
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction
10899
+ )
10900
+ )
10901
+ end
10902
+ attr_reader :client_action
10903
+
10904
+ sig do
10905
+ params(
10906
+ client_action:
10907
+ T.nilable(
10908
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::OrHash
10909
+ )
10910
+ ).void
10911
+ end
10912
+ attr_writer :client_action
10913
+
10306
10914
  # The original content payload
10307
10915
  sig do
10308
10916
  returns(
@@ -10367,6 +10975,10 @@ module ModerationAPI
10367
10975
  id: String,
10368
10976
  author_id: T.nilable(String),
10369
10977
  channel_key: T.nilable(String),
10978
+ client_action:
10979
+ T.nilable(
10980
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::OrHash
10981
+ ),
10370
10982
  content:
10371
10983
  T.any(
10372
10984
  ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text::OrHash,
@@ -10400,6 +11012,8 @@ module ModerationAPI
10400
11012
  # The channel the content was submitted to, identified by your customer-defined
10401
11013
  # channel key.
10402
11014
  channel_key:,
11015
+ # A recommendation from your own client-side flagging.
11016
+ client_action:,
10403
11017
  # The original content payload
10404
11018
  content:,
10405
11019
  # Conversation grouping ID, if any
@@ -10427,6 +11041,10 @@ module ModerationAPI
10427
11041
  id: String,
10428
11042
  author_id: T.nilable(String),
10429
11043
  channel_key: T.nilable(String),
11044
+ client_action:
11045
+ T.nilable(
11046
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction
11047
+ ),
10430
11048
  content:
10431
11049
  T.any(
10432
11050
  ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text,
@@ -10456,6 +11074,172 @@ module ModerationAPI
10456
11074
  def to_hash
10457
11075
  end
10458
11076
 
11077
+ class ClientAction < ModerationAPI::Internal::Type::BaseModel
11078
+ OrHash =
11079
+ T.type_alias do
11080
+ T.any(
11081
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction,
11082
+ ModerationAPI::Internal::AnyHash
11083
+ )
11084
+ end
11085
+
11086
+ # Your recommendation for the content: allow, review, or reject.
11087
+ sig do
11088
+ returns(
11089
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol
11090
+ )
11091
+ end
11092
+ attr_accessor :action
11093
+
11094
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
11095
+ # applies it when stricter than ours; 'override' replaces ours outright.
11096
+ sig do
11097
+ returns(
11098
+ T.nilable(
11099
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol
11100
+ )
11101
+ )
11102
+ end
11103
+ attr_reader :behavior
11104
+
11105
+ sig do
11106
+ params(
11107
+ behavior:
11108
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol
11109
+ ).void
11110
+ end
11111
+ attr_writer :behavior
11112
+
11113
+ # A human-readable explanation for your recommendation.
11114
+ sig { returns(T.nilable(String)) }
11115
+ attr_reader :reason
11116
+
11117
+ sig { params(reason: String).void }
11118
+ attr_writer :reason
11119
+
11120
+ # Where your recommendation came from, e.g. "banned-ip".
11121
+ sig { returns(T.nilable(String)) }
11122
+ attr_reader :source
11123
+
11124
+ sig { params(source: String).void }
11125
+ attr_writer :source
11126
+
11127
+ # A recommendation from your own client-side flagging.
11128
+ sig do
11129
+ params(
11130
+ action:
11131
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol,
11132
+ behavior:
11133
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol,
11134
+ reason: String,
11135
+ source: String
11136
+ ).returns(T.attached_class)
11137
+ end
11138
+ def self.new(
11139
+ # Your recommendation for the content: allow, review, or reject.
11140
+ action:,
11141
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
11142
+ # applies it when stricter than ours; 'override' replaces ours outright.
11143
+ behavior: nil,
11144
+ # A human-readable explanation for your recommendation.
11145
+ reason: nil,
11146
+ # Where your recommendation came from, e.g. "banned-ip".
11147
+ source: nil
11148
+ )
11149
+ end
11150
+
11151
+ sig do
11152
+ override.returns(
11153
+ {
11154
+ action:
11155
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol,
11156
+ behavior:
11157
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol,
11158
+ reason: String,
11159
+ source: String
11160
+ }
11161
+ )
11162
+ end
11163
+ def to_hash
11164
+ end
11165
+
11166
+ # Your recommendation for the content: allow, review, or reject.
11167
+ module Action
11168
+ extend ModerationAPI::Internal::Type::Enum
11169
+
11170
+ TaggedSymbol =
11171
+ T.type_alias do
11172
+ T.all(
11173
+ Symbol,
11174
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action
11175
+ )
11176
+ end
11177
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11178
+
11179
+ REVIEW =
11180
+ T.let(
11181
+ :review,
11182
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol
11183
+ )
11184
+ ALLOW =
11185
+ T.let(
11186
+ :allow,
11187
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol
11188
+ )
11189
+ REJECT =
11190
+ T.let(
11191
+ :reject,
11192
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol
11193
+ )
11194
+
11195
+ sig do
11196
+ override.returns(
11197
+ T::Array[
11198
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol
11199
+ ]
11200
+ )
11201
+ end
11202
+ def self.values
11203
+ end
11204
+ end
11205
+
11206
+ # How your recommendation combines with ours. Defaults to 'escalate', which only
11207
+ # applies it when stricter than ours; 'override' replaces ours outright.
11208
+ module Behavior
11209
+ extend ModerationAPI::Internal::Type::Enum
11210
+
11211
+ TaggedSymbol =
11212
+ T.type_alias do
11213
+ T.all(
11214
+ Symbol,
11215
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior
11216
+ )
11217
+ end
11218
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11219
+
11220
+ OVERRIDE =
11221
+ T.let(
11222
+ :override,
11223
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
11224
+ )
11225
+ ESCALATE =
11226
+ T.let(
11227
+ :escalate,
11228
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
11229
+ )
11230
+
11231
+ sig do
11232
+ override.returns(
11233
+ T::Array[
11234
+ ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol
11235
+ ]
11236
+ )
11237
+ end
11238
+ def self.values
11239
+ end
11240
+ end
11241
+ end
11242
+
10459
11243
  # The original content payload
10460
11244
  module Content
10461
11245
  extend ModerationAPI::Internal::Type::Union