moderation_api 2.29.0 → 2.30.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: e2350c050b80f874a232572392ab7463447330756ed429006cecffe2928e05b9
4
- data.tar.gz: 7a949aa4c1fb39585afeeffddcf3fed9b23d6b849ae61618a8ef2c12128c9b89
3
+ metadata.gz: 88c56468c63f2e926f6336f72eb799fb36694b1686961857eec651029168e662
4
+ data.tar.gz: 581cef7094c7df16934326d247b31e75f3242f159ca1962b50e3dd0205c95d02
5
5
  SHA512:
6
- metadata.gz: 23e6887e8991a2334f1fb809a9651deadb007237057a822895bd6d36fe1de0886276e839bc4696e021bf1e8e1191de2ae6f96fac0030e5237535cdaa82f5e6cd
7
- data.tar.gz: 7fefcb77748af33e78185587b17891c1138102b66aa010686e66df18e5b92fe5b6bedacb3e348e7fecd0709d0dd21e40d7be522492bf690c99a2e9b916d34b9f
6
+ metadata.gz: 97a51cc12d65dbe7f6968f2d76f4fb7de09cb85029fe94853e1d7e4747bfeb242081c94b4b0f50c527918d87eb7845f183faa100293df10efb4fad65a4a01903
7
+ data.tar.gz: 7b23712ad1567cfa36b575e3e74c1b55b5a65f39ddd4fad0300caddd77dc06c264c0d2073b85389a1492ee45e10d555d4ee3d6b9ec0cf9a8c8bb05d744c23725
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.30.0 (2026-08-04)
4
+
5
+ Full Changelog: [v2.29.0...v2.30.0](https://github.com/moderation-api/sdk-ruby/compare/v2.29.0...v2.30.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([2a572ac](https://github.com/moderation-api/sdk-ruby/commit/2a572ac911b6ed3e6d96b1d98da8d0c98032ff68))
10
+
3
11
  ## 2.29.0 (2026-07-23)
4
12
 
5
13
  Full Changelog: [v2.28.0...v2.29.0](https://github.com/moderation-api/sdk-ruby/compare/v2.28.0...v2.29.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.29.0"
18
+ gem "moderation_api", "~> 2.30.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -871,12 +871,13 @@ module ModerationAPI
871
871
  required :action, enum: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action }
872
872
 
873
873
  # @!attribute reason_codes
874
- # The reason code for the recommendation. Can be used to display a reason to the
875
- # user.
874
+ # Reason codes for the recommendation. Standard codes plus a `rule:<key>` code
875
+ # identifying the rule that produced the action. Can be used to display a reason
876
+ # to the user.
876
877
  #
877
- # @return [Array<Symbol, ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode>]
878
+ # @return [Array<Symbol, String, ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode>]
878
879
  required :reason_codes,
879
- -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode] }
880
+ -> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode] }
880
881
 
881
882
  # @!attribute matched_rules
882
883
  # Rules that matched during evaluation, if rules engine is active.
@@ -893,7 +894,7 @@ module ModerationAPI
893
894
  #
894
895
  # @param action [Symbol, ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action] The action to take based on the recommendation
895
896
  #
896
- # @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
897
+ # @param reason_codes [Array<Symbol, String, ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode>] Reason codes for the recommendation. Standard codes plus a `rule:<key>` code ide
897
898
  #
898
899
  # @param matched_rules [Array<ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule>] Rules that matched during evaluation, if rules engine is active.
899
900
 
@@ -912,7 +913,38 @@ module ModerationAPI
912
913
  end
913
914
 
914
915
  module ReasonCode
915
- extend ModerationAPI::Internal::Type::Enum
916
+ extend ModerationAPI::Internal::Type::Union
917
+
918
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::SEVERITY_REJECT }
919
+
920
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::SEVERITY_REVIEW }
921
+
922
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::AUTHOR_BLOCK }
923
+
924
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::DRY_RUN }
925
+
926
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TRUSTED_ALLOW }
927
+
928
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::UNTRUSTED_SEVERITY }
929
+
930
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::RULE_MATCH }
931
+
932
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::RULE_DEFAULT }
933
+
934
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::RULE_FALLBACK }
935
+
936
+ variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::CLIENT_OVERRIDE }
937
+
938
+ variant String
939
+
940
+ # @!method self.variants
941
+ # @return [Array(Symbol, String)]
942
+
943
+ define_sorbet_constant!(:Variants) do
944
+ T.type_alias { T.any(ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol, String) }
945
+ end
946
+
947
+ # @!group
916
948
 
917
949
  SEVERITY_REJECT = :severity_reject
918
950
  SEVERITY_REVIEW = :severity_review
@@ -925,8 +957,7 @@ module ModerationAPI
925
957
  RULE_FALLBACK = :rule_fallback
926
958
  CLIENT_OVERRIDE = :client_override
927
959
 
928
- # @!method self.values
929
- # @return [Array<Symbol>]
960
+ # @!endgroup
930
961
  end
931
962
 
932
963
  class MatchedRule < ModerationAPI::Internal::Type::BaseModel
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ModerationAPI
4
- VERSION = "2.29.0"
4
+ VERSION = "2.30.0"
5
5
  end
@@ -1625,12 +1625,13 @@ module ModerationAPI
1625
1625
  end
1626
1626
  attr_accessor :action
1627
1627
 
1628
- # The reason code for the recommendation. Can be used to display a reason to the
1629
- # user.
1628
+ # Reason codes for the recommendation. Standard codes plus a `rule:<key>` code
1629
+ # identifying the rule that produced the action. Can be used to display a reason
1630
+ # to the user.
1630
1631
  sig do
1631
1632
  returns(
1632
1633
  T::Array[
1633
- ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1634
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::Variants
1634
1635
  ]
1635
1636
  )
1636
1637
  end
@@ -1665,7 +1666,10 @@ module ModerationAPI
1665
1666
  ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::OrSymbol,
1666
1667
  reason_codes:
1667
1668
  T::Array[
1668
- ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::OrSymbol
1669
+ T.any(
1670
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::OrSymbol,
1671
+ String
1672
+ )
1669
1673
  ],
1670
1674
  matched_rules:
1671
1675
  T::Array[
@@ -1676,8 +1680,9 @@ module ModerationAPI
1676
1680
  def self.new(
1677
1681
  # The action to take based on the recommendation
1678
1682
  action:,
1679
- # The reason code for the recommendation. Can be used to display a reason to the
1680
- # user.
1683
+ # Reason codes for the recommendation. Standard codes plus a `rule:<key>` code
1684
+ # identifying the rule that produced the action. Can be used to display a reason
1685
+ # to the user.
1681
1686
  reason_codes:,
1682
1687
  # Rules that matched during evaluation, if rules engine is active.
1683
1688
  matched_rules: nil
@@ -1691,7 +1696,7 @@ module ModerationAPI
1691
1696
  ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::TaggedSymbol,
1692
1697
  reason_codes:
1693
1698
  T::Array[
1694
- ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1699
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::Variants
1695
1700
  ],
1696
1701
  matched_rules:
1697
1702
  T::Array[
@@ -1744,7 +1749,25 @@ module ModerationAPI
1744
1749
  end
1745
1750
 
1746
1751
  module ReasonCode
1747
- extend ModerationAPI::Internal::Type::Enum
1752
+ extend ModerationAPI::Internal::Type::Union
1753
+
1754
+ Variants =
1755
+ T.type_alias do
1756
+ T.any(
1757
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol,
1758
+ String
1759
+ )
1760
+ end
1761
+
1762
+ sig do
1763
+ override.returns(
1764
+ T::Array[
1765
+ ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::Variants
1766
+ ]
1767
+ )
1768
+ end
1769
+ def self.variants
1770
+ end
1748
1771
 
1749
1772
  TaggedSymbol =
1750
1773
  T.type_alias do
@@ -1805,16 +1828,6 @@ module ModerationAPI
1805
1828
  :client_override,
1806
1829
  ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1807
1830
  )
1808
-
1809
- sig do
1810
- override.returns(
1811
- T::Array[
1812
- ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol
1813
- ]
1814
- )
1815
- end
1816
- def self.values
1817
- end
1818
1831
  end
1819
1832
 
1820
1833
  class MatchedRule < ModerationAPI::Internal::Type::BaseModel
@@ -758,9 +758,12 @@ module ModerationAPI
758
758
  | :rule_default
759
759
  | :rule_fallback
760
760
  | :client_override
761
+ | String
761
762
 
762
763
  module ReasonCode
763
- extend ModerationAPI::Internal::Type::Enum
764
+ extend ModerationAPI::Internal::Type::Union
765
+
766
+ def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code]
764
767
 
765
768
  SEVERITY_REJECT: :severity_reject
766
769
  SEVERITY_REVIEW: :severity_review
@@ -772,8 +775,6 @@ module ModerationAPI
772
775
  RULE_DEFAULT: :rule_default
773
776
  RULE_FALLBACK: :rule_fallback
774
777
  CLIENT_OVERRIDE: :client_override
775
-
776
- def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code]
777
778
  end
778
779
 
779
780
  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.29.0
4
+ version: 2.30.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-07-23 00:00:00.000000000 Z
11
+ date: 2026-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi