moderation_api 2.34.0 → 2.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6c81ee2a9da518fa7c2d46dd6de06482739a80d3c7bc72e415c459e049b5118
4
- data.tar.gz: 30591937048d8e2662f1b4106fa0a1e1478220759995543efd8305a24e31fbc0
3
+ metadata.gz: 58efdd27a36bd37a1e9b27e916fe3591f4ad21e43f3dac943a48cdee701f84e5
4
+ data.tar.gz: cb32bc627ec56cc42a6c0831ef68a25da57a591695662f30c6177799d34e252e
5
5
  SHA512:
6
- metadata.gz: f22f683cf8f5a19e6f672ea2823869a529aae0a159ad30a7eda1e47fb1ca5f2714d1bab28b21b05af334ad8fa645797cf9efbcddf709bfa5f18fb86e13f5140e
7
- data.tar.gz: 0e6cd98b619b02bbdcfa571fcae9f9903c8062f95554f1673649c5c8341190c3d321a15fcaffcde5eeb7b1c5fbd87f35f7cfe00e8dd4df04d0db1b4df6786c93
6
+ metadata.gz: ef3456ebe2958f141802fd4d6e46dc1ce03ad95805d5158658b0c1a6cd3aca172a659c4d8758f0737ca1f3a65d9727c84d138f403af835618f6e817a712162b8
7
+ data.tar.gz: 703455e6b65df299a0b01e4ee53bb51ab68e25e7d4188025d467d6200c529261bd49171ed5eecdaa1c9dedac41f4a012f16809c4a5f5daf45268ce20b57c2cfd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.35.0 (2026-08-21)
4
+
5
+ Full Changelog: [v2.34.0...v2.35.0](https://github.com/moderation-api/sdk-ruby/compare/v2.34.0...v2.35.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([ce30b48](https://github.com/moderation-api/sdk-ruby/commit/ce30b48c33ec082b8143b3af082d07de83c44a3d))
10
+
3
11
  ## 2.34.0 (2026-08-20)
4
12
 
5
13
  Full Changelog: [v2.33.0...v2.34.0](https://github.com/moderation-api/sdk-ruby/compare/v2.33.0...v2.34.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "moderation_api", "~> 2.34.0"
18
+ gem "moderation_api", "~> 2.35.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -11,6 +11,16 @@ module ModerationAPI
11
11
  # @return [ModerationAPI::Models::ContentSubmitResponse::Author, nil]
12
12
  required :author, -> { ModerationAPI::Models::ContentSubmitResponse::Author }, nil?: true
13
13
 
14
+ # @!attribute casebook
15
+ # What your casebook — the record of your past moderation decisions — found for
16
+ # this content, or null when it had nothing close enough to say, when the matching
17
+ # cases disagreed, or when casebook lookups are not switched on for this channel.
18
+ # Reports what the casebook found; whether it decided the outcome is shown in
19
+ # `recommendation`, where a higher-priority rule may have settled the item first.
20
+ #
21
+ # @return [ModerationAPI::Models::ContentSubmitResponse::Casebook, nil]
22
+ required :casebook, -> { ModerationAPI::Models::ContentSubmitResponse::Casebook }, nil?: true
23
+
14
24
  # @!attribute content
15
25
  # Potentially modified content.
16
26
  #
@@ -56,12 +66,14 @@ module ModerationAPI
56
66
  optional :errors,
57
67
  -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Error] }
58
68
 
59
- # @!method initialize(author:, content:, evaluation:, insights:, meta:, policies:, recommendation:, errors: nil)
69
+ # @!method initialize(author:, casebook:, content:, evaluation:, insights:, meta:, policies:, recommendation:, errors: nil)
60
70
  # Some parameter documentations has been truncated, see
61
71
  # {ModerationAPI::Models::ContentSubmitResponse} for more details.
62
72
  #
63
73
  # @param author [ModerationAPI::Models::ContentSubmitResponse::Author, nil] The author of the content if your account has authors enabled. Requires you to s
64
74
  #
75
+ # @param casebook [ModerationAPI::Models::ContentSubmitResponse::Casebook, nil] What your casebook — the record of your past moderation decisions — found for th
76
+ #
65
77
  # @param content [ModerationAPI::Models::ContentSubmitResponse::Content] Potentially modified content.
66
78
  #
67
79
  # @param evaluation [ModerationAPI::Models::ContentSubmitResponse::Evaluation] The evaluation of the content after running the channel policies.
@@ -178,6 +190,109 @@ module ModerationAPI
178
190
  end
179
191
  end
180
192
 
193
+ # @see ModerationAPI::Models::ContentSubmitResponse#casebook
194
+ class Casebook < ModerationAPI::Internal::Type::BaseModel
195
+ # @!attribute agreement
196
+ # How unanimous the matching cases are, from 0 to 1: the share of them that
197
+ # decided this way, ignoring how many there are. Always at least 0.8 when a ruling
198
+ # is returned — below that the casebook reports a disagreement instead of picking
199
+ # a side — so it tells you how clean the consensus was, and is not a threshold to
200
+ # re-apply yourself.
201
+ #
202
+ # @return [Float]
203
+ required :agreement, Float
204
+
205
+ # @!attribute case_count
206
+ # How many of your past cases backed this ruling.
207
+ #
208
+ # @return [Float]
209
+ required :case_count, Float
210
+
211
+ # @!attribute confidence
212
+ # How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled
213
+ # by how much evidence backs it, so a handful of close, recent cases outweighs one
214
+ # distant one. Older cases count for less, halving in weight roughly every 180
215
+ # days. This is the number to use in rules when you want a strength condition.
216
+ #
217
+ # @return [Float]
218
+ required :confidence, Float
219
+
220
+ # @!attribute similarity
221
+ # How close the nearest matching case is, from 0 to 1. 1 means the content is
222
+ # identical to something you have already decided.
223
+ #
224
+ # @return [Float]
225
+ required :similarity, Float
226
+
227
+ # @!attribute topic
228
+ # The topic the closest matching case is filed under, or null when it has not been
229
+ # grouped into one yet.
230
+ #
231
+ # @return [ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic, nil]
232
+ required :topic, -> { ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic }, nil?: true
233
+
234
+ # @!attribute verdict
235
+ # The ruling your past decisions point to for this content.
236
+ #
237
+ # @return [Symbol, ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict]
238
+ required :verdict, enum: -> { ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict }
239
+
240
+ # @!method initialize(agreement:, case_count:, confidence:, similarity:, topic:, verdict:)
241
+ # Some parameter documentations has been truncated, see
242
+ # {ModerationAPI::Models::ContentSubmitResponse::Casebook} for more details.
243
+ #
244
+ # What your casebook — the record of your past moderation decisions — found for
245
+ # this content, or null when it had nothing close enough to say, when the matching
246
+ # cases disagreed, or when casebook lookups are not switched on for this channel.
247
+ # Reports what the casebook found; whether it decided the outcome is shown in
248
+ # `recommendation`, where a higher-priority rule may have settled the item first.
249
+ #
250
+ # @param agreement [Float] How unanimous the matching cases are, from 0 to 1: the share of them that decide
251
+ #
252
+ # @param case_count [Float] How many of your past cases backed this ruling.
253
+ #
254
+ # @param confidence [Float] How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled b
255
+ #
256
+ # @param similarity [Float] How close the nearest matching case is, from 0 to 1. 1 means the content is iden
257
+ #
258
+ # @param topic [ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic, nil] The topic the closest matching case is filed under, or null when it has not been
259
+ #
260
+ # @param verdict [Symbol, ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict] The ruling your past decisions point to for this content.
261
+
262
+ # @see ModerationAPI::Models::ContentSubmitResponse::Casebook#topic
263
+ class Topic < ModerationAPI::Internal::Type::BaseModel
264
+ # @!attribute id
265
+ #
266
+ # @return [String]
267
+ required :id, String
268
+
269
+ # @!attribute label
270
+ #
271
+ # @return [String]
272
+ required :label, String
273
+
274
+ # @!method initialize(id:, label:)
275
+ # The topic the closest matching case is filed under, or null when it has not been
276
+ # grouped into one yet.
277
+ #
278
+ # @param id [String]
279
+ # @param label [String]
280
+ end
281
+
282
+ # The ruling your past decisions point to for this content.
283
+ #
284
+ # @see ModerationAPI::Models::ContentSubmitResponse::Casebook#verdict
285
+ module Verdict
286
+ extend ModerationAPI::Internal::Type::Enum
287
+
288
+ ALLOW = :allow
289
+ REJECT = :reject
290
+
291
+ # @!method self.values
292
+ # @return [Array<Symbol>]
293
+ end
294
+ end
295
+
181
296
  # @see ModerationAPI::Models::ContentSubmitResponse#content
182
297
  class Content < ModerationAPI::Internal::Type::BaseModel
183
298
  # @!attribute id
@@ -935,6 +1050,8 @@ module ModerationAPI
935
1050
 
936
1051
  variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::CLIENT_OVERRIDE }
937
1052
 
1053
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::CASEBOOK_MATCH }
1054
+
938
1055
  variant String
939
1056
 
940
1057
  # @!method self.variants
@@ -956,6 +1073,7 @@ module ModerationAPI
956
1073
  RULE_DEFAULT = :rule_default
957
1074
  RULE_FALLBACK = :rule_fallback
958
1075
  CLIENT_OVERRIDE = :client_override
1076
+ CASEBOOK_MATCH = :casebook_match
959
1077
 
960
1078
  # @!endgroup
961
1079
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ModerationAPI
4
- VERSION = "2.34.0"
4
+ VERSION = "2.35.0"
5
5
  end
@@ -28,6 +28,28 @@ module ModerationAPI
28
28
  end
29
29
  attr_writer :author
30
30
 
31
+ # What your casebook — the record of your past moderation decisions — found for
32
+ # this content, or null when it had nothing close enough to say, when the matching
33
+ # cases disagreed, or when casebook lookups are not switched on for this channel.
34
+ # Reports what the casebook found; whether it decided the outcome is shown in
35
+ # `recommendation`, where a higher-priority rule may have settled the item first.
36
+ sig do
37
+ returns(
38
+ T.nilable(ModerationAPI::Models::ContentSubmitResponse::Casebook)
39
+ )
40
+ end
41
+ attr_reader :casebook
42
+
43
+ sig do
44
+ params(
45
+ casebook:
46
+ T.nilable(
47
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::OrHash
48
+ )
49
+ ).void
50
+ end
51
+ attr_writer :casebook
52
+
31
53
  # Potentially modified content.
32
54
  sig { returns(ModerationAPI::Models::ContentSubmitResponse::Content) }
33
55
  attr_reader :content
@@ -122,6 +144,10 @@ module ModerationAPI
122
144
  T.nilable(
123
145
  ModerationAPI::Models::ContentSubmitResponse::Author::OrHash
124
146
  ),
147
+ casebook:
148
+ T.nilable(
149
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::OrHash
150
+ ),
125
151
  content:
126
152
  ModerationAPI::Models::ContentSubmitResponse::Content::OrHash,
127
153
  evaluation:
@@ -153,6 +179,12 @@ module ModerationAPI
153
179
  # The author of the content if your account has authors enabled. Requires you to
154
180
  # send authorId when submitting content.
155
181
  author:,
182
+ # What your casebook — the record of your past moderation decisions — found for
183
+ # this content, or null when it had nothing close enough to say, when the matching
184
+ # cases disagreed, or when casebook lookups are not switched on for this channel.
185
+ # Reports what the casebook found; whether it decided the outcome is shown in
186
+ # `recommendation`, where a higher-priority rule may have settled the item first.
187
+ casebook:,
156
188
  # Potentially modified content.
157
189
  content:,
158
190
  # The evaluation of the content after running the channel policies.
@@ -175,6 +207,8 @@ module ModerationAPI
175
207
  {
176
208
  author:
177
209
  T.nilable(ModerationAPI::Models::ContentSubmitResponse::Author),
210
+ casebook:
211
+ T.nilable(ModerationAPI::Models::ContentSubmitResponse::Casebook),
178
212
  content: ModerationAPI::Models::ContentSubmitResponse::Content,
179
213
  evaluation:
180
214
  ModerationAPI::Models::ContentSubmitResponse::Evaluation,
@@ -419,6 +453,193 @@ module ModerationAPI
419
453
  end
420
454
  end
421
455
 
456
+ class Casebook < ModerationAPI::Internal::Type::BaseModel
457
+ OrHash =
458
+ T.type_alias do
459
+ T.any(
460
+ ModerationAPI::Models::ContentSubmitResponse::Casebook,
461
+ ModerationAPI::Internal::AnyHash
462
+ )
463
+ end
464
+
465
+ # How unanimous the matching cases are, from 0 to 1: the share of them that
466
+ # decided this way, ignoring how many there are. Always at least 0.8 when a ruling
467
+ # is returned — below that the casebook reports a disagreement instead of picking
468
+ # a side — so it tells you how clean the consensus was, and is not a threshold to
469
+ # re-apply yourself.
470
+ sig { returns(Float) }
471
+ attr_accessor :agreement
472
+
473
+ # How many of your past cases backed this ruling.
474
+ sig { returns(Float) }
475
+ attr_accessor :case_count
476
+
477
+ # How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled
478
+ # by how much evidence backs it, so a handful of close, recent cases outweighs one
479
+ # distant one. Older cases count for less, halving in weight roughly every 180
480
+ # days. This is the number to use in rules when you want a strength condition.
481
+ sig { returns(Float) }
482
+ attr_accessor :confidence
483
+
484
+ # How close the nearest matching case is, from 0 to 1. 1 means the content is
485
+ # identical to something you have already decided.
486
+ sig { returns(Float) }
487
+ attr_accessor :similarity
488
+
489
+ # The topic the closest matching case is filed under, or null when it has not been
490
+ # grouped into one yet.
491
+ sig do
492
+ returns(
493
+ T.nilable(
494
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic
495
+ )
496
+ )
497
+ end
498
+ attr_reader :topic
499
+
500
+ sig do
501
+ params(
502
+ topic:
503
+ T.nilable(
504
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic::OrHash
505
+ )
506
+ ).void
507
+ end
508
+ attr_writer :topic
509
+
510
+ # The ruling your past decisions point to for this content.
511
+ sig do
512
+ returns(
513
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol
514
+ )
515
+ end
516
+ attr_accessor :verdict
517
+
518
+ # What your casebook — the record of your past moderation decisions — found for
519
+ # this content, or null when it had nothing close enough to say, when the matching
520
+ # cases disagreed, or when casebook lookups are not switched on for this channel.
521
+ # Reports what the casebook found; whether it decided the outcome is shown in
522
+ # `recommendation`, where a higher-priority rule may have settled the item first.
523
+ sig do
524
+ params(
525
+ agreement: Float,
526
+ case_count: Float,
527
+ confidence: Float,
528
+ similarity: Float,
529
+ topic:
530
+ T.nilable(
531
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic::OrHash
532
+ ),
533
+ verdict:
534
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::OrSymbol
535
+ ).returns(T.attached_class)
536
+ end
537
+ def self.new(
538
+ # How unanimous the matching cases are, from 0 to 1: the share of them that
539
+ # decided this way, ignoring how many there are. Always at least 0.8 when a ruling
540
+ # is returned — below that the casebook reports a disagreement instead of picking
541
+ # a side — so it tells you how clean the consensus was, and is not a threshold to
542
+ # re-apply yourself.
543
+ agreement:,
544
+ # How many of your past cases backed this ruling.
545
+ case_count:,
546
+ # How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled
547
+ # by how much evidence backs it, so a handful of close, recent cases outweighs one
548
+ # distant one. Older cases count for less, halving in weight roughly every 180
549
+ # days. This is the number to use in rules when you want a strength condition.
550
+ confidence:,
551
+ # How close the nearest matching case is, from 0 to 1. 1 means the content is
552
+ # identical to something you have already decided.
553
+ similarity:,
554
+ # The topic the closest matching case is filed under, or null when it has not been
555
+ # grouped into one yet.
556
+ topic:,
557
+ # The ruling your past decisions point to for this content.
558
+ verdict:
559
+ )
560
+ end
561
+
562
+ sig do
563
+ override.returns(
564
+ {
565
+ agreement: Float,
566
+ case_count: Float,
567
+ confidence: Float,
568
+ similarity: Float,
569
+ topic:
570
+ T.nilable(
571
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic
572
+ ),
573
+ verdict:
574
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol
575
+ }
576
+ )
577
+ end
578
+ def to_hash
579
+ end
580
+
581
+ class Topic < ModerationAPI::Internal::Type::BaseModel
582
+ OrHash =
583
+ T.type_alias do
584
+ T.any(
585
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic,
586
+ ModerationAPI::Internal::AnyHash
587
+ )
588
+ end
589
+
590
+ sig { returns(String) }
591
+ attr_accessor :id
592
+
593
+ sig { returns(String) }
594
+ attr_accessor :label
595
+
596
+ # The topic the closest matching case is filed under, or null when it has not been
597
+ # grouped into one yet.
598
+ sig { params(id: String, label: String).returns(T.attached_class) }
599
+ def self.new(id:, label:)
600
+ end
601
+
602
+ sig { override.returns({ id: String, label: String }) }
603
+ def to_hash
604
+ end
605
+ end
606
+
607
+ # The ruling your past decisions point to for this content.
608
+ module Verdict
609
+ extend ModerationAPI::Internal::Type::Enum
610
+
611
+ TaggedSymbol =
612
+ T.type_alias do
613
+ T.all(
614
+ Symbol,
615
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict
616
+ )
617
+ end
618
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
619
+
620
+ ALLOW =
621
+ T.let(
622
+ :allow,
623
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol
624
+ )
625
+ REJECT =
626
+ T.let(
627
+ :reject,
628
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol
629
+ )
630
+
631
+ sig do
632
+ override.returns(
633
+ T::Array[
634
+ ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol
635
+ ]
636
+ )
637
+ end
638
+ def self.values
639
+ end
640
+ end
641
+ end
642
+
422
643
  class Content < ModerationAPI::Internal::Type::BaseModel
423
644
  OrHash =
424
645
  T.type_alias do
@@ -1828,6 +2049,11 @@ module ModerationAPI
1828
2049
  :client_override,
1829
2050
  ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1830
2051
  )
2052
+ CASEBOOK_MATCH =
2053
+ T.let(
2054
+ :casebook_match,
2055
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
2056
+ )
1831
2057
  end
1832
2058
 
1833
2059
  class MatchedRule < ModerationAPI::Internal::Type::BaseModel
@@ -3,6 +3,7 @@ module ModerationAPI
3
3
  type content_submit_response =
4
4
  {
5
5
  author: ModerationAPI::Models::ContentSubmitResponse::Author?,
6
+ casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook?,
6
7
  content: ModerationAPI::Models::ContentSubmitResponse::Content,
7
8
  evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation,
8
9
  insights: ::Array[ModerationAPI::Models::ContentSubmitResponse::insight],
@@ -15,6 +16,8 @@ module ModerationAPI
15
16
  class ContentSubmitResponse < ModerationAPI::Internal::Type::BaseModel
16
17
  attr_accessor author: ModerationAPI::Models::ContentSubmitResponse::Author?
17
18
 
19
+ attr_accessor casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook?
20
+
18
21
  attr_accessor content: ModerationAPI::Models::ContentSubmitResponse::Content
19
22
 
20
23
  attr_accessor evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation
@@ -35,6 +38,7 @@ module ModerationAPI
35
38
 
36
39
  def initialize: (
37
40
  author: ModerationAPI::Models::ContentSubmitResponse::Author?,
41
+ casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook?,
38
42
  content: ModerationAPI::Models::ContentSubmitResponse::Content,
39
43
  evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation,
40
44
  insights: ::Array[ModerationAPI::Models::ContentSubmitResponse::insight],
@@ -46,6 +50,7 @@ module ModerationAPI
46
50
 
47
51
  def to_hash: -> {
48
52
  author: ModerationAPI::Models::ContentSubmitResponse::Author?,
53
+ casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook?,
49
54
  content: ModerationAPI::Models::ContentSubmitResponse::Content,
50
55
  evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation,
51
56
  insights: ::Array[ModerationAPI::Models::ContentSubmitResponse::insight],
@@ -128,6 +133,71 @@ module ModerationAPI
128
133
  end
129
134
  end
130
135
 
136
+ type casebook =
137
+ {
138
+ agreement: Float,
139
+ case_count: Float,
140
+ confidence: Float,
141
+ similarity: Float,
142
+ topic: ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic?,
143
+ verdict: ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict
144
+ }
145
+
146
+ class Casebook < ModerationAPI::Internal::Type::BaseModel
147
+ attr_accessor agreement: Float
148
+
149
+ attr_accessor case_count: Float
150
+
151
+ attr_accessor confidence: Float
152
+
153
+ attr_accessor similarity: Float
154
+
155
+ attr_accessor topic: ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic?
156
+
157
+ attr_accessor verdict: ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict
158
+
159
+ def initialize: (
160
+ agreement: Float,
161
+ case_count: Float,
162
+ confidence: Float,
163
+ similarity: Float,
164
+ topic: ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic?,
165
+ verdict: ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict
166
+ ) -> void
167
+
168
+ def to_hash: -> {
169
+ agreement: Float,
170
+ case_count: Float,
171
+ confidence: Float,
172
+ similarity: Float,
173
+ topic: ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic?,
174
+ verdict: ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict
175
+ }
176
+
177
+ type topic = { id: String, label: String }
178
+
179
+ class Topic < ModerationAPI::Internal::Type::BaseModel
180
+ attr_accessor id: String
181
+
182
+ attr_accessor label: String
183
+
184
+ def initialize: (id: String, label: String) -> void
185
+
186
+ def to_hash: -> { id: String, label: String }
187
+ end
188
+
189
+ type verdict = :allow | :reject
190
+
191
+ module Verdict
192
+ extend ModerationAPI::Internal::Type::Enum
193
+
194
+ ALLOW: :allow
195
+ REJECT: :reject
196
+
197
+ def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict]
198
+ end
199
+ end
200
+
131
201
  type content =
132
202
  {
133
203
  id: String,
@@ -758,6 +828,7 @@ module ModerationAPI
758
828
  | :rule_default
759
829
  | :rule_fallback
760
830
  | :client_override
831
+ | :casebook_match
761
832
  | String
762
833
 
763
834
  module ReasonCode
@@ -775,6 +846,7 @@ module ModerationAPI
775
846
  RULE_DEFAULT: :rule_default
776
847
  RULE_FALLBACK: :rule_fallback
777
848
  CLIENT_OVERRIDE: :client_override
849
+ CASEBOOK_MATCH: :casebook_match
778
850
  end
779
851
 
780
852
  type matched_rule = { key: String, name: String }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moderation_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.34.0
4
+ version: 2.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moderation API
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-20 00:00:00.000000000 Z
11
+ date: 2026-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi