moderation_api 2.13.0 → 2.14.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: 1d542ff9749f9a6c137824b1931515cde3c27460ea505c1ac50d0f68b2c8dad8
4
- data.tar.gz: 3935357457505f9afe64119557934f402cd695493cb5b1078639b01d7704ed9d
3
+ metadata.gz: 192a6f5315a5b55f4f6b762d716b3d9ce040c173a93985c1155a5debfd69b053
4
+ data.tar.gz: 8bcf509d720e00d1744c76dffb6aba7f4b6ebf750fad5859816df308c0f96c6f
5
5
  SHA512:
6
- metadata.gz: 99fdd9f0531aae436f3ece40c4f06700b115bbe11500cb348b8f60306b98eab20757d1a3acc685b3d158598cea5a3e85be863a9a0045c3846395258b5d2c3ff9
7
- data.tar.gz: 9dbb208ced1e89d2775f156199bbf8b5502971679cc1f0b28a476b7b092cb34d9e254a43bfcc6a472653ff2623098ed409fc345fce36a0f8847e063d2fbe56f2
6
+ metadata.gz: 8c684c5b8669978604e1333bb800c61f2af4be0e95d79f4bc9578c56bfc2462a224d0f994fbc3343d99a7996acf130de7a5abd2e53fc3a01456a7a75dd6493d6
7
+ data.tar.gz: 336064028d535e29f792abf679b80454b5eab96eda45418f6e9f7fc07fa65c61513ea14e6fba4cc01396dad62855e59aa68051fea48183576064b39d70db09a1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.14.0 (2026-04-29)
4
+
5
+ Full Changelog: [v2.13.0...v2.14.0](https://github.com/moderation-api/sdk-ruby/compare/v2.13.0...v2.14.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([ac53fee](https://github.com/moderation-api/sdk-ruby/commit/ac53feeb7fe66fde8f0eac2462e36f5c8aa5da6a))
10
+
3
11
  ## 2.13.0 (2026-04-28)
4
12
 
5
13
  Full Changelog: [v2.12.0...v2.13.0](https://github.com/moderation-api/sdk-ruby/compare/v2.12.0...v2.13.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.13.0"
18
+ gem "moderation_api", "~> 2.14.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -849,7 +849,14 @@ module ModerationAPI
849
849
  required :reason_codes,
850
850
  -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode] }
851
851
 
852
- # @!method initialize(action:, reason_codes:)
852
+ # @!attribute matched_rules
853
+ # Rules that matched during evaluation, if rules engine is active.
854
+ #
855
+ # @return [Array<ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule>, nil]
856
+ optional :matched_rules,
857
+ -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule] }
858
+
859
+ # @!method initialize(action:, reason_codes:, matched_rules: nil)
853
860
  # Some parameter documentations has been truncated, see
854
861
  # {ModerationAPI::Models::ContentSubmitResponse::Recommendation} for more details.
855
862
  #
@@ -858,6 +865,8 @@ module ModerationAPI
858
865
  # @param action [Symbol, ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action] The action to take based on the recommendation
859
866
  #
860
867
  # @param reason_codes [Array<Symbol, ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode>] The reason code for the recommendation. Can be used to display a reason to the u
868
+ #
869
+ # @param matched_rules [Array<ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule>] Rules that matched during evaluation, if rules engine is active.
861
870
 
862
871
  # The action to take based on the recommendation
863
872
  #
@@ -882,10 +891,29 @@ module ModerationAPI
882
891
  DRY_RUN = :dry_run
883
892
  TRUSTED_ALLOW = :trusted_allow
884
893
  UNTRUSTED_SEVERITY = :untrusted_severity
894
+ RULE_MATCH = :rule_match
895
+ RULE_DEFAULT = :rule_default
896
+ RULE_FALLBACK = :rule_fallback
885
897
 
886
898
  # @!method self.values
887
899
  # @return [Array<Symbol>]
888
900
  end
901
+
902
+ class MatchedRule < ModerationAPI::Internal::Type::BaseModel
903
+ # @!attribute key
904
+ #
905
+ # @return [String]
906
+ required :key, String
907
+
908
+ # @!attribute name
909
+ #
910
+ # @return [String]
911
+ required :name, String
912
+
913
+ # @!method initialize(key:, name:)
914
+ # @param key [String]
915
+ # @param name [String]
916
+ end
889
917
  end
890
918
 
891
919
  class Error < ModerationAPI::Internal::Type::BaseModel
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ModerationAPI
4
- VERSION = "2.13.0"
4
+ VERSION = "2.14.0"
5
5
  end
@@ -1599,6 +1599,28 @@ module ModerationAPI
1599
1599
  end
1600
1600
  attr_accessor :reason_codes
1601
1601
 
1602
+ # Rules that matched during evaluation, if rules engine is active.
1603
+ sig do
1604
+ returns(
1605
+ T.nilable(
1606
+ T::Array[
1607
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule
1608
+ ]
1609
+ )
1610
+ )
1611
+ end
1612
+ attr_reader :matched_rules
1613
+
1614
+ sig do
1615
+ params(
1616
+ matched_rules:
1617
+ T::Array[
1618
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule::OrHash
1619
+ ]
1620
+ ).void
1621
+ end
1622
+ attr_writer :matched_rules
1623
+
1602
1624
  # The recommendation for the content based on the evaluation.
1603
1625
  sig do
1604
1626
  params(
@@ -1607,6 +1629,10 @@ module ModerationAPI
1607
1629
  reason_codes:
1608
1630
  T::Array[
1609
1631
  ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::OrSymbol
1632
+ ],
1633
+ matched_rules:
1634
+ T::Array[
1635
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule::OrHash
1610
1636
  ]
1611
1637
  ).returns(T.attached_class)
1612
1638
  end
@@ -1615,7 +1641,9 @@ module ModerationAPI
1615
1641
  action:,
1616
1642
  # The reason code for the recommendation. Can be used to display a reason to the
1617
1643
  # user.
1618
- reason_codes:
1644
+ reason_codes:,
1645
+ # Rules that matched during evaluation, if rules engine is active.
1646
+ matched_rules: nil
1619
1647
  )
1620
1648
  end
1621
1649
 
@@ -1627,6 +1655,10 @@ module ModerationAPI
1627
1655
  reason_codes:
1628
1656
  T::Array[
1629
1657
  ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1658
+ ],
1659
+ matched_rules:
1660
+ T::Array[
1661
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule
1630
1662
  ]
1631
1663
  }
1632
1664
  )
@@ -1716,6 +1748,21 @@ module ModerationAPI
1716
1748
  :untrusted_severity,
1717
1749
  ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1718
1750
  )
1751
+ RULE_MATCH =
1752
+ T.let(
1753
+ :rule_match,
1754
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1755
+ )
1756
+ RULE_DEFAULT =
1757
+ T.let(
1758
+ :rule_default,
1759
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1760
+ )
1761
+ RULE_FALLBACK =
1762
+ T.let(
1763
+ :rule_fallback,
1764
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1765
+ )
1719
1766
 
1720
1767
  sig do
1721
1768
  override.returns(
@@ -1727,6 +1774,30 @@ module ModerationAPI
1727
1774
  def self.values
1728
1775
  end
1729
1776
  end
1777
+
1778
+ class MatchedRule < ModerationAPI::Internal::Type::BaseModel
1779
+ OrHash =
1780
+ T.type_alias do
1781
+ T.any(
1782
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule,
1783
+ ModerationAPI::Internal::AnyHash
1784
+ )
1785
+ end
1786
+
1787
+ sig { returns(String) }
1788
+ attr_accessor :key
1789
+
1790
+ sig { returns(String) }
1791
+ attr_accessor :name
1792
+
1793
+ sig { params(key: String, name: String).returns(T.attached_class) }
1794
+ def self.new(key:, name:)
1795
+ end
1796
+
1797
+ sig { override.returns({ key: String, name: String }) }
1798
+ def to_hash
1799
+ end
1800
+ end
1730
1801
  end
1731
1802
 
1732
1803
  class Error < ModerationAPI::Internal::Type::BaseModel
@@ -680,7 +680,8 @@ module ModerationAPI
680
680
  type recommendation =
681
681
  {
682
682
  action: ModerationAPI::Models::ContentSubmitResponse::Recommendation::action,
683
- reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code]
683
+ reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code],
684
+ matched_rules: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule]
684
685
  }
685
686
 
686
687
  class Recommendation < ModerationAPI::Internal::Type::BaseModel
@@ -688,14 +689,22 @@ module ModerationAPI
688
689
 
689
690
  attr_accessor reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code]
690
691
 
692
+ attr_reader matched_rules: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule]?
693
+
694
+ def matched_rules=: (
695
+ ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule]
696
+ ) -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule]
697
+
691
698
  def initialize: (
692
699
  action: ModerationAPI::Models::ContentSubmitResponse::Recommendation::action,
693
- reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code]
700
+ reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code],
701
+ ?matched_rules: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule]
694
702
  ) -> void
695
703
 
696
704
  def to_hash: -> {
697
705
  action: ModerationAPI::Models::ContentSubmitResponse::Recommendation::action,
698
- reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code]
706
+ reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code],
707
+ matched_rules: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule]
699
708
  }
700
709
 
701
710
  type action = :review | :allow | :reject
@@ -717,6 +726,9 @@ module ModerationAPI
717
726
  | :dry_run
718
727
  | :trusted_allow
719
728
  | :untrusted_severity
729
+ | :rule_match
730
+ | :rule_default
731
+ | :rule_fallback
720
732
 
721
733
  module ReasonCode
722
734
  extend ModerationAPI::Internal::Type::Enum
@@ -727,9 +739,24 @@ module ModerationAPI
727
739
  DRY_RUN: :dry_run
728
740
  TRUSTED_ALLOW: :trusted_allow
729
741
  UNTRUSTED_SEVERITY: :untrusted_severity
742
+ RULE_MATCH: :rule_match
743
+ RULE_DEFAULT: :rule_default
744
+ RULE_FALLBACK: :rule_fallback
730
745
 
731
746
  def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code]
732
747
  end
748
+
749
+ type matched_rule = { key: String, name: String }
750
+
751
+ class MatchedRule < ModerationAPI::Internal::Type::BaseModel
752
+ attr_accessor key: String
753
+
754
+ attr_accessor name: String
755
+
756
+ def initialize: (key: String, name: String) -> void
757
+
758
+ def to_hash: -> { key: String, name: String }
759
+ end
733
760
  end
734
761
 
735
762
  type error = { id: String, message: 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.13.0
4
+ version: 2.14.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-04-28 00:00:00.000000000 Z
11
+ date: 2026-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi