moderation_api 2.11.3 → 2.12.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 +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +1 -1
- data/lib/moderation_api/models/content_submit_params.rb +29 -1
- data/lib/moderation_api/models/content_submit_response.rb +129 -1
- data/lib/moderation_api/version.rb +1 -1
- data/rbi/moderation_api/models/content_submit_params.rbi +45 -5
- data/rbi/moderation_api/models/content_submit_response.rbi +244 -3
- data/sig/moderation_api/models/content_submit_params.rbs +25 -2
- data/sig/moderation_api/models/content_submit_response.rbs +120 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 171b36d318351c624de945dd4c57f71415df6b9e7bce45e709b630cc50d00ac7
|
|
4
|
+
data.tar.gz: 9fbeaa70401a4c51ff51735ae61656a4b50b2c21936c762e10bd6bbf0dee5543
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a0ad5af98d6a4627061026470c68a11e3f4a55dc896b6fc9dd17369242497c0349d08a1bd068270e444d12a2bb3e5c6b43d1914ecea8e6b7a6926877c52640c
|
|
7
|
+
data.tar.gz: 848fb257946509d3b797f5600d3ca75136ba76844e30c352c8d309b943452bab16319efb12a5b8901d38517c8a4f024f0a960f9c8af60a2a2258eefa6e3bb64e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.12.0 (2026-04-24)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.11.3...v2.12.0](https://github.com/moderation-api/sdk-ruby/compare/v2.11.3...v2.12.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([18b3b6d](https://github.com/moderation-api/sdk-ruby/commit/18b3b6dce2befe3c2b0051d0dc33b737d99308a9))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **internal:** more robust bootstrap script ([2217d9c](https://github.com/moderation-api/sdk-ruby/commit/2217d9c080e5fbc4276ec3fed81e91b51f9d653e))
|
|
15
|
+
|
|
3
16
|
## 2.11.3 (2026-04-09)
|
|
4
17
|
|
|
5
18
|
Full Changelog: [v2.11.2...v2.11.3](https://github.com/moderation-api/sdk-ruby/compare/v2.11.2...v2.11.3)
|
data/README.md
CHANGED
|
@@ -1026,14 +1026,42 @@ module ModerationAPI
|
|
|
1026
1026
|
# @return [Boolean]
|
|
1027
1027
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
1028
1028
|
|
|
1029
|
+
# @!attribute allowlist_wordlist_ids
|
|
1030
|
+
# IDs of wordlists whose entries are treated as allowed URL domains. Matches
|
|
1031
|
+
# short-circuit the risk model and are never flagged.
|
|
1032
|
+
#
|
|
1033
|
+
# @return [Array<String>, nil]
|
|
1034
|
+
optional :allowlist_wordlist_ids,
|
|
1035
|
+
ModerationAPI::Internal::Type::ArrayOf[String],
|
|
1036
|
+
api_name: :allowlistWordlistIds
|
|
1037
|
+
|
|
1038
|
+
# @!attribute blocklist_wordlist_ids
|
|
1039
|
+
# IDs of wordlists whose entries are treated as blocked URL domains. Matches
|
|
1040
|
+
# short-circuit the risk model and are always flagged. Blocklists take precedence
|
|
1041
|
+
# over allowlists.
|
|
1042
|
+
#
|
|
1043
|
+
# @return [Array<String>, nil]
|
|
1044
|
+
optional :blocklist_wordlist_ids,
|
|
1045
|
+
ModerationAPI::Internal::Type::ArrayOf[String],
|
|
1046
|
+
api_name: :blocklistWordlistIds
|
|
1047
|
+
|
|
1029
1048
|
# @!attribute threshold
|
|
1030
1049
|
#
|
|
1031
1050
|
# @return [Float, nil]
|
|
1032
1051
|
optional :threshold, Float
|
|
1033
1052
|
|
|
1034
|
-
# @!method initialize(flag:, threshold: nil, id: :url_risk)
|
|
1053
|
+
# @!method initialize(flag:, allowlist_wordlist_ids: nil, blocklist_wordlist_ids: nil, threshold: nil, id: :url_risk)
|
|
1054
|
+
# Some parameter documentations has been truncated, see
|
|
1055
|
+
# {ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk} for more details.
|
|
1056
|
+
#
|
|
1035
1057
|
# @param flag [Boolean]
|
|
1058
|
+
#
|
|
1059
|
+
# @param allowlist_wordlist_ids [Array<String>] IDs of wordlists whose entries are treated as allowed URL domains. Matches short
|
|
1060
|
+
#
|
|
1061
|
+
# @param blocklist_wordlist_ids [Array<String>] IDs of wordlists whose entries are treated as blocked URL domains. Matches short
|
|
1062
|
+
#
|
|
1036
1063
|
# @param threshold [Float]
|
|
1064
|
+
#
|
|
1037
1065
|
# @param id [Symbol, :url_risk]
|
|
1038
1066
|
end
|
|
1039
1067
|
|
|
@@ -694,10 +694,138 @@ module ModerationAPI
|
|
|
694
694
|
# @return [Array<Integer>]
|
|
695
695
|
required :span, ModerationAPI::Internal::Type::ArrayOf[Integer]
|
|
696
696
|
|
|
697
|
-
# @!
|
|
697
|
+
# @!attribute entity_type
|
|
698
|
+
# Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII
|
|
699
|
+
# matches. Absent for URL Risk and wordlist matches where the type is already
|
|
700
|
+
# encoded in the parent label.
|
|
701
|
+
#
|
|
702
|
+
# @return [String, nil]
|
|
703
|
+
optional :entity_type, String
|
|
704
|
+
|
|
705
|
+
# @!attribute reasons
|
|
706
|
+
# Stable codes explaining why a URL was flagged (URL Risk only).
|
|
707
|
+
#
|
|
708
|
+
# @return [Array<String>, nil]
|
|
709
|
+
optional :reasons, ModerationAPI::Internal::Type::ArrayOf[String]
|
|
710
|
+
|
|
711
|
+
# @!attribute signals
|
|
712
|
+
# Observable properties of a URL (URL Risk only). Absent for allow/block list
|
|
713
|
+
# matches.
|
|
714
|
+
#
|
|
715
|
+
# @return [ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals, nil]
|
|
716
|
+
optional :signals,
|
|
717
|
+
-> { ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals }
|
|
718
|
+
|
|
719
|
+
# @!method initialize(match:, probability:, span:, entity_type: nil, reasons: nil, signals: nil)
|
|
720
|
+
# Some parameter documentations has been truncated, see
|
|
721
|
+
# {ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match}
|
|
722
|
+
# for more details.
|
|
723
|
+
#
|
|
698
724
|
# @param match [String]
|
|
725
|
+
#
|
|
699
726
|
# @param probability [Float]
|
|
727
|
+
#
|
|
700
728
|
# @param span [Array<Integer>]
|
|
729
|
+
#
|
|
730
|
+
# @param entity_type [String] Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII
|
|
731
|
+
#
|
|
732
|
+
# @param reasons [Array<String>] Stable codes explaining why a URL was flagged (URL Risk only).
|
|
733
|
+
#
|
|
734
|
+
# @param signals [ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals] Observable properties of a URL (URL Risk only). Absent for allow/block list matc
|
|
735
|
+
|
|
736
|
+
# @see ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match#signals
|
|
737
|
+
class Signals < ModerationAPI::Internal::Type::BaseModel
|
|
738
|
+
# @!attribute bot_protection
|
|
739
|
+
#
|
|
740
|
+
# @return [Boolean, nil]
|
|
741
|
+
required :bot_protection, ModerationAPI::Internal::Type::Boolean, nil?: true
|
|
742
|
+
|
|
743
|
+
# @!attribute brand_impersonation
|
|
744
|
+
#
|
|
745
|
+
# @return [ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation, nil]
|
|
746
|
+
required :brand_impersonation,
|
|
747
|
+
-> { ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation },
|
|
748
|
+
nil?: true
|
|
749
|
+
|
|
750
|
+
# @!attribute domain_age_days
|
|
751
|
+
#
|
|
752
|
+
# @return [Integer, nil]
|
|
753
|
+
required :domain_age_days, Integer, nil?: true
|
|
754
|
+
|
|
755
|
+
# @!attribute final_url
|
|
756
|
+
#
|
|
757
|
+
# @return [String, nil]
|
|
758
|
+
required :final_url, String, nil?: true
|
|
759
|
+
|
|
760
|
+
# @!attribute has_email_setup
|
|
761
|
+
#
|
|
762
|
+
# @return [Boolean, nil]
|
|
763
|
+
required :has_email_setup, ModerationAPI::Internal::Type::Boolean, nil?: true
|
|
764
|
+
|
|
765
|
+
# @!attribute has_suspicious_characters
|
|
766
|
+
#
|
|
767
|
+
# @return [Boolean]
|
|
768
|
+
required :has_suspicious_characters, ModerationAPI::Internal::Type::Boolean
|
|
769
|
+
|
|
770
|
+
# @!attribute is_link_shortener
|
|
771
|
+
#
|
|
772
|
+
# @return [Boolean]
|
|
773
|
+
required :is_link_shortener, ModerationAPI::Internal::Type::Boolean
|
|
774
|
+
|
|
775
|
+
# @!attribute is_reported
|
|
776
|
+
#
|
|
777
|
+
# @return [Boolean]
|
|
778
|
+
required :is_reported, ModerationAPI::Internal::Type::Boolean
|
|
779
|
+
|
|
780
|
+
# @!attribute redirect_count
|
|
781
|
+
#
|
|
782
|
+
# @return [Integer, nil]
|
|
783
|
+
required :redirect_count, Integer, nil?: true
|
|
784
|
+
|
|
785
|
+
# @!method initialize(bot_protection:, brand_impersonation:, domain_age_days:, final_url:, has_email_setup:, has_suspicious_characters:, is_link_shortener:, is_reported:, redirect_count:)
|
|
786
|
+
# Observable properties of a URL (URL Risk only). Absent for allow/block list
|
|
787
|
+
# matches.
|
|
788
|
+
#
|
|
789
|
+
# @param bot_protection [Boolean, nil]
|
|
790
|
+
# @param brand_impersonation [ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation, nil]
|
|
791
|
+
# @param domain_age_days [Integer, nil]
|
|
792
|
+
# @param final_url [String, nil]
|
|
793
|
+
# @param has_email_setup [Boolean, nil]
|
|
794
|
+
# @param has_suspicious_characters [Boolean]
|
|
795
|
+
# @param is_link_shortener [Boolean]
|
|
796
|
+
# @param is_reported [Boolean]
|
|
797
|
+
# @param redirect_count [Integer, nil]
|
|
798
|
+
|
|
799
|
+
# @see ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals#brand_impersonation
|
|
800
|
+
class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel
|
|
801
|
+
# @!attribute brand
|
|
802
|
+
#
|
|
803
|
+
# @return [String]
|
|
804
|
+
required :brand, String
|
|
805
|
+
|
|
806
|
+
# @!attribute method_
|
|
807
|
+
#
|
|
808
|
+
# @return [Symbol, ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method]
|
|
809
|
+
required :method_,
|
|
810
|
+
enum: -> { ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method },
|
|
811
|
+
api_name: :method
|
|
812
|
+
|
|
813
|
+
# @!method initialize(brand:, method_:)
|
|
814
|
+
# @param brand [String]
|
|
815
|
+
# @param method_ [Symbol, ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method]
|
|
816
|
+
|
|
817
|
+
# @see ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation#method_
|
|
818
|
+
module Method
|
|
819
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
820
|
+
|
|
821
|
+
REGISTERED_DOMAIN_TOKEN = :registered_domain_token
|
|
822
|
+
SUBDOMAIN_TOKEN = :subdomain_token
|
|
823
|
+
|
|
824
|
+
# @!method self.values
|
|
825
|
+
# @return [Array<Symbol>]
|
|
826
|
+
end
|
|
827
|
+
end
|
|
828
|
+
end
|
|
701
829
|
end
|
|
702
830
|
end
|
|
703
831
|
|
|
@@ -1872,6 +1872,23 @@ module ModerationAPI
|
|
|
1872
1872
|
sig { returns(T::Boolean) }
|
|
1873
1873
|
attr_accessor :flag
|
|
1874
1874
|
|
|
1875
|
+
# IDs of wordlists whose entries are treated as allowed URL domains. Matches
|
|
1876
|
+
# short-circuit the risk model and are never flagged.
|
|
1877
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
1878
|
+
attr_reader :allowlist_wordlist_ids
|
|
1879
|
+
|
|
1880
|
+
sig { params(allowlist_wordlist_ids: T::Array[String]).void }
|
|
1881
|
+
attr_writer :allowlist_wordlist_ids
|
|
1882
|
+
|
|
1883
|
+
# IDs of wordlists whose entries are treated as blocked URL domains. Matches
|
|
1884
|
+
# short-circuit the risk model and are always flagged. Blocklists take precedence
|
|
1885
|
+
# over allowlists.
|
|
1886
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
1887
|
+
attr_reader :blocklist_wordlist_ids
|
|
1888
|
+
|
|
1889
|
+
sig { params(blocklist_wordlist_ids: T::Array[String]).void }
|
|
1890
|
+
attr_writer :blocklist_wordlist_ids
|
|
1891
|
+
|
|
1875
1892
|
sig { returns(T.nilable(Float)) }
|
|
1876
1893
|
attr_reader :threshold
|
|
1877
1894
|
|
|
@@ -1879,15 +1896,38 @@ module ModerationAPI
|
|
|
1879
1896
|
attr_writer :threshold
|
|
1880
1897
|
|
|
1881
1898
|
sig do
|
|
1882
|
-
params(
|
|
1883
|
-
T
|
|
1884
|
-
|
|
1899
|
+
params(
|
|
1900
|
+
flag: T::Boolean,
|
|
1901
|
+
allowlist_wordlist_ids: T::Array[String],
|
|
1902
|
+
blocklist_wordlist_ids: T::Array[String],
|
|
1903
|
+
threshold: Float,
|
|
1904
|
+
id: Symbol
|
|
1905
|
+
).returns(T.attached_class)
|
|
1885
1906
|
end
|
|
1886
|
-
def self.new(
|
|
1907
|
+
def self.new(
|
|
1908
|
+
flag:,
|
|
1909
|
+
# IDs of wordlists whose entries are treated as allowed URL domains. Matches
|
|
1910
|
+
# short-circuit the risk model and are never flagged.
|
|
1911
|
+
allowlist_wordlist_ids: nil,
|
|
1912
|
+
# IDs of wordlists whose entries are treated as blocked URL domains. Matches
|
|
1913
|
+
# short-circuit the risk model and are always flagged. Blocklists take precedence
|
|
1914
|
+
# over allowlists.
|
|
1915
|
+
blocklist_wordlist_ids: nil,
|
|
1916
|
+
threshold: nil,
|
|
1917
|
+
id: :url_risk
|
|
1918
|
+
)
|
|
1887
1919
|
end
|
|
1888
1920
|
|
|
1889
1921
|
sig do
|
|
1890
|
-
override.returns(
|
|
1922
|
+
override.returns(
|
|
1923
|
+
{
|
|
1924
|
+
id: Symbol,
|
|
1925
|
+
flag: T::Boolean,
|
|
1926
|
+
allowlist_wordlist_ids: T::Array[String],
|
|
1927
|
+
blocklist_wordlist_ids: T::Array[String],
|
|
1928
|
+
threshold: Float
|
|
1929
|
+
}
|
|
1930
|
+
)
|
|
1891
1931
|
end
|
|
1892
1932
|
def to_hash
|
|
1893
1933
|
end
|
|
@@ -1299,23 +1299,264 @@ module ModerationAPI
|
|
|
1299
1299
|
sig { returns(T::Array[Integer]) }
|
|
1300
1300
|
attr_accessor :span
|
|
1301
1301
|
|
|
1302
|
+
# Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII
|
|
1303
|
+
# matches. Absent for URL Risk and wordlist matches where the type is already
|
|
1304
|
+
# encoded in the parent label.
|
|
1305
|
+
sig { returns(T.nilable(String)) }
|
|
1306
|
+
attr_reader :entity_type
|
|
1307
|
+
|
|
1308
|
+
sig { params(entity_type: String).void }
|
|
1309
|
+
attr_writer :entity_type
|
|
1310
|
+
|
|
1311
|
+
# Stable codes explaining why a URL was flagged (URL Risk only).
|
|
1312
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
1313
|
+
attr_reader :reasons
|
|
1314
|
+
|
|
1315
|
+
sig { params(reasons: T::Array[String]).void }
|
|
1316
|
+
attr_writer :reasons
|
|
1317
|
+
|
|
1318
|
+
# Observable properties of a URL (URL Risk only). Absent for allow/block list
|
|
1319
|
+
# matches.
|
|
1320
|
+
sig do
|
|
1321
|
+
returns(
|
|
1322
|
+
T.nilable(
|
|
1323
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals
|
|
1324
|
+
)
|
|
1325
|
+
)
|
|
1326
|
+
end
|
|
1327
|
+
attr_reader :signals
|
|
1328
|
+
|
|
1329
|
+
sig do
|
|
1330
|
+
params(
|
|
1331
|
+
signals:
|
|
1332
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::OrHash
|
|
1333
|
+
).void
|
|
1334
|
+
end
|
|
1335
|
+
attr_writer :signals
|
|
1336
|
+
|
|
1302
1337
|
sig do
|
|
1303
1338
|
params(
|
|
1304
1339
|
match: String,
|
|
1305
1340
|
probability: Float,
|
|
1306
|
-
span: T::Array[Integer]
|
|
1341
|
+
span: T::Array[Integer],
|
|
1342
|
+
entity_type: String,
|
|
1343
|
+
reasons: T::Array[String],
|
|
1344
|
+
signals:
|
|
1345
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::OrHash
|
|
1307
1346
|
).returns(T.attached_class)
|
|
1308
1347
|
end
|
|
1309
|
-
def self.new(
|
|
1348
|
+
def self.new(
|
|
1349
|
+
match:,
|
|
1350
|
+
probability:,
|
|
1351
|
+
span:,
|
|
1352
|
+
# Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII
|
|
1353
|
+
# matches. Absent for URL Risk and wordlist matches where the type is already
|
|
1354
|
+
# encoded in the parent label.
|
|
1355
|
+
entity_type: nil,
|
|
1356
|
+
# Stable codes explaining why a URL was flagged (URL Risk only).
|
|
1357
|
+
reasons: nil,
|
|
1358
|
+
# Observable properties of a URL (URL Risk only). Absent for allow/block list
|
|
1359
|
+
# matches.
|
|
1360
|
+
signals: nil
|
|
1361
|
+
)
|
|
1310
1362
|
end
|
|
1311
1363
|
|
|
1312
1364
|
sig do
|
|
1313
1365
|
override.returns(
|
|
1314
|
-
{
|
|
1366
|
+
{
|
|
1367
|
+
match: String,
|
|
1368
|
+
probability: Float,
|
|
1369
|
+
span: T::Array[Integer],
|
|
1370
|
+
entity_type: String,
|
|
1371
|
+
reasons: T::Array[String],
|
|
1372
|
+
signals:
|
|
1373
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals
|
|
1374
|
+
}
|
|
1315
1375
|
)
|
|
1316
1376
|
end
|
|
1317
1377
|
def to_hash
|
|
1318
1378
|
end
|
|
1379
|
+
|
|
1380
|
+
class Signals < ModerationAPI::Internal::Type::BaseModel
|
|
1381
|
+
OrHash =
|
|
1382
|
+
T.type_alias do
|
|
1383
|
+
T.any(
|
|
1384
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals,
|
|
1385
|
+
ModerationAPI::Internal::AnyHash
|
|
1386
|
+
)
|
|
1387
|
+
end
|
|
1388
|
+
|
|
1389
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1390
|
+
attr_accessor :bot_protection
|
|
1391
|
+
|
|
1392
|
+
sig do
|
|
1393
|
+
returns(
|
|
1394
|
+
T.nilable(
|
|
1395
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation
|
|
1396
|
+
)
|
|
1397
|
+
)
|
|
1398
|
+
end
|
|
1399
|
+
attr_reader :brand_impersonation
|
|
1400
|
+
|
|
1401
|
+
sig do
|
|
1402
|
+
params(
|
|
1403
|
+
brand_impersonation:
|
|
1404
|
+
T.nilable(
|
|
1405
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::OrHash
|
|
1406
|
+
)
|
|
1407
|
+
).void
|
|
1408
|
+
end
|
|
1409
|
+
attr_writer :brand_impersonation
|
|
1410
|
+
|
|
1411
|
+
sig { returns(T.nilable(Integer)) }
|
|
1412
|
+
attr_accessor :domain_age_days
|
|
1413
|
+
|
|
1414
|
+
sig { returns(T.nilable(String)) }
|
|
1415
|
+
attr_accessor :final_url
|
|
1416
|
+
|
|
1417
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1418
|
+
attr_accessor :has_email_setup
|
|
1419
|
+
|
|
1420
|
+
sig { returns(T::Boolean) }
|
|
1421
|
+
attr_accessor :has_suspicious_characters
|
|
1422
|
+
|
|
1423
|
+
sig { returns(T::Boolean) }
|
|
1424
|
+
attr_accessor :is_link_shortener
|
|
1425
|
+
|
|
1426
|
+
sig { returns(T::Boolean) }
|
|
1427
|
+
attr_accessor :is_reported
|
|
1428
|
+
|
|
1429
|
+
sig { returns(T.nilable(Integer)) }
|
|
1430
|
+
attr_accessor :redirect_count
|
|
1431
|
+
|
|
1432
|
+
# Observable properties of a URL (URL Risk only). Absent for allow/block list
|
|
1433
|
+
# matches.
|
|
1434
|
+
sig do
|
|
1435
|
+
params(
|
|
1436
|
+
bot_protection: T.nilable(T::Boolean),
|
|
1437
|
+
brand_impersonation:
|
|
1438
|
+
T.nilable(
|
|
1439
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::OrHash
|
|
1440
|
+
),
|
|
1441
|
+
domain_age_days: T.nilable(Integer),
|
|
1442
|
+
final_url: T.nilable(String),
|
|
1443
|
+
has_email_setup: T.nilable(T::Boolean),
|
|
1444
|
+
has_suspicious_characters: T::Boolean,
|
|
1445
|
+
is_link_shortener: T::Boolean,
|
|
1446
|
+
is_reported: T::Boolean,
|
|
1447
|
+
redirect_count: T.nilable(Integer)
|
|
1448
|
+
).returns(T.attached_class)
|
|
1449
|
+
end
|
|
1450
|
+
def self.new(
|
|
1451
|
+
bot_protection:,
|
|
1452
|
+
brand_impersonation:,
|
|
1453
|
+
domain_age_days:,
|
|
1454
|
+
final_url:,
|
|
1455
|
+
has_email_setup:,
|
|
1456
|
+
has_suspicious_characters:,
|
|
1457
|
+
is_link_shortener:,
|
|
1458
|
+
is_reported:,
|
|
1459
|
+
redirect_count:
|
|
1460
|
+
)
|
|
1461
|
+
end
|
|
1462
|
+
|
|
1463
|
+
sig do
|
|
1464
|
+
override.returns(
|
|
1465
|
+
{
|
|
1466
|
+
bot_protection: T.nilable(T::Boolean),
|
|
1467
|
+
brand_impersonation:
|
|
1468
|
+
T.nilable(
|
|
1469
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation
|
|
1470
|
+
),
|
|
1471
|
+
domain_age_days: T.nilable(Integer),
|
|
1472
|
+
final_url: T.nilable(String),
|
|
1473
|
+
has_email_setup: T.nilable(T::Boolean),
|
|
1474
|
+
has_suspicious_characters: T::Boolean,
|
|
1475
|
+
is_link_shortener: T::Boolean,
|
|
1476
|
+
is_reported: T::Boolean,
|
|
1477
|
+
redirect_count: T.nilable(Integer)
|
|
1478
|
+
}
|
|
1479
|
+
)
|
|
1480
|
+
end
|
|
1481
|
+
def to_hash
|
|
1482
|
+
end
|
|
1483
|
+
|
|
1484
|
+
class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel
|
|
1485
|
+
OrHash =
|
|
1486
|
+
T.type_alias do
|
|
1487
|
+
T.any(
|
|
1488
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation,
|
|
1489
|
+
ModerationAPI::Internal::AnyHash
|
|
1490
|
+
)
|
|
1491
|
+
end
|
|
1492
|
+
|
|
1493
|
+
sig { returns(String) }
|
|
1494
|
+
attr_accessor :brand
|
|
1495
|
+
|
|
1496
|
+
sig do
|
|
1497
|
+
returns(
|
|
1498
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol
|
|
1499
|
+
)
|
|
1500
|
+
end
|
|
1501
|
+
attr_accessor :method_
|
|
1502
|
+
|
|
1503
|
+
sig do
|
|
1504
|
+
params(
|
|
1505
|
+
brand: String,
|
|
1506
|
+
method_:
|
|
1507
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::OrSymbol
|
|
1508
|
+
).returns(T.attached_class)
|
|
1509
|
+
end
|
|
1510
|
+
def self.new(brand:, method_:)
|
|
1511
|
+
end
|
|
1512
|
+
|
|
1513
|
+
sig do
|
|
1514
|
+
override.returns(
|
|
1515
|
+
{
|
|
1516
|
+
brand: String,
|
|
1517
|
+
method_:
|
|
1518
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol
|
|
1519
|
+
}
|
|
1520
|
+
)
|
|
1521
|
+
end
|
|
1522
|
+
def to_hash
|
|
1523
|
+
end
|
|
1524
|
+
|
|
1525
|
+
module Method
|
|
1526
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
1527
|
+
|
|
1528
|
+
TaggedSymbol =
|
|
1529
|
+
T.type_alias do
|
|
1530
|
+
T.all(
|
|
1531
|
+
Symbol,
|
|
1532
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method
|
|
1533
|
+
)
|
|
1534
|
+
end
|
|
1535
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1536
|
+
|
|
1537
|
+
REGISTERED_DOMAIN_TOKEN =
|
|
1538
|
+
T.let(
|
|
1539
|
+
:registered_domain_token,
|
|
1540
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol
|
|
1541
|
+
)
|
|
1542
|
+
SUBDOMAIN_TOKEN =
|
|
1543
|
+
T.let(
|
|
1544
|
+
:subdomain_token,
|
|
1545
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol
|
|
1546
|
+
)
|
|
1547
|
+
|
|
1548
|
+
sig do
|
|
1549
|
+
override.returns(
|
|
1550
|
+
T::Array[
|
|
1551
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol
|
|
1552
|
+
]
|
|
1553
|
+
)
|
|
1554
|
+
end
|
|
1555
|
+
def self.values
|
|
1556
|
+
end
|
|
1557
|
+
end
|
|
1558
|
+
end
|
|
1559
|
+
end
|
|
1319
1560
|
end
|
|
1320
1561
|
end
|
|
1321
1562
|
|
|
@@ -875,24 +875,47 @@ module ModerationAPI
|
|
|
875
875
|
end
|
|
876
876
|
end
|
|
877
877
|
|
|
878
|
-
type url_risk =
|
|
878
|
+
type url_risk =
|
|
879
|
+
{
|
|
880
|
+
id: :url_risk,
|
|
881
|
+
flag: bool,
|
|
882
|
+
allowlist_wordlist_ids: ::Array[String],
|
|
883
|
+
blocklist_wordlist_ids: ::Array[String],
|
|
884
|
+
threshold: Float
|
|
885
|
+
}
|
|
879
886
|
|
|
880
887
|
class URLRisk < ModerationAPI::Internal::Type::BaseModel
|
|
881
888
|
attr_accessor id: :url_risk
|
|
882
889
|
|
|
883
890
|
attr_accessor flag: bool
|
|
884
891
|
|
|
892
|
+
attr_reader allowlist_wordlist_ids: ::Array[String]?
|
|
893
|
+
|
|
894
|
+
def allowlist_wordlist_ids=: (::Array[String]) -> ::Array[String]
|
|
895
|
+
|
|
896
|
+
attr_reader blocklist_wordlist_ids: ::Array[String]?
|
|
897
|
+
|
|
898
|
+
def blocklist_wordlist_ids=: (::Array[String]) -> ::Array[String]
|
|
899
|
+
|
|
885
900
|
attr_reader threshold: Float?
|
|
886
901
|
|
|
887
902
|
def threshold=: (Float) -> Float
|
|
888
903
|
|
|
889
904
|
def initialize: (
|
|
890
905
|
flag: bool,
|
|
906
|
+
?allowlist_wordlist_ids: ::Array[String],
|
|
907
|
+
?blocklist_wordlist_ids: ::Array[String],
|
|
891
908
|
?threshold: Float,
|
|
892
909
|
?id: :url_risk
|
|
893
910
|
) -> void
|
|
894
911
|
|
|
895
|
-
def to_hash: -> {
|
|
912
|
+
def to_hash: -> {
|
|
913
|
+
id: :url_risk,
|
|
914
|
+
flag: bool,
|
|
915
|
+
allowlist_wordlist_ids: ::Array[String],
|
|
916
|
+
blocklist_wordlist_ids: ::Array[String],
|
|
917
|
+
threshold: Float
|
|
918
|
+
}
|
|
896
919
|
end
|
|
897
920
|
|
|
898
921
|
type guideline =
|
|
@@ -534,7 +534,14 @@ module ModerationAPI
|
|
|
534
534
|
}
|
|
535
535
|
|
|
536
536
|
type match =
|
|
537
|
-
{
|
|
537
|
+
{
|
|
538
|
+
match: String,
|
|
539
|
+
probability: Float,
|
|
540
|
+
span: ::Array[Integer],
|
|
541
|
+
entity_type: String,
|
|
542
|
+
reasons: ::Array[String],
|
|
543
|
+
signals: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals
|
|
544
|
+
}
|
|
538
545
|
|
|
539
546
|
class Match < ModerationAPI::Internal::Type::BaseModel
|
|
540
547
|
attr_accessor match: String
|
|
@@ -543,17 +550,127 @@ module ModerationAPI
|
|
|
543
550
|
|
|
544
551
|
attr_accessor span: ::Array[Integer]
|
|
545
552
|
|
|
553
|
+
attr_reader entity_type: String?
|
|
554
|
+
|
|
555
|
+
def entity_type=: (String) -> String
|
|
556
|
+
|
|
557
|
+
attr_reader reasons: ::Array[String]?
|
|
558
|
+
|
|
559
|
+
def reasons=: (::Array[String]) -> ::Array[String]
|
|
560
|
+
|
|
561
|
+
attr_reader signals: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals?
|
|
562
|
+
|
|
563
|
+
def signals=: (
|
|
564
|
+
ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals
|
|
565
|
+
) -> ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals
|
|
566
|
+
|
|
546
567
|
def initialize: (
|
|
547
568
|
match: String,
|
|
548
569
|
probability: Float,
|
|
549
|
-
span: ::Array[Integer]
|
|
570
|
+
span: ::Array[Integer],
|
|
571
|
+
?entity_type: String,
|
|
572
|
+
?reasons: ::Array[String],
|
|
573
|
+
?signals: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals
|
|
550
574
|
) -> void
|
|
551
575
|
|
|
552
576
|
def to_hash: -> {
|
|
553
577
|
match: String,
|
|
554
578
|
probability: Float,
|
|
555
|
-
span: ::Array[Integer]
|
|
579
|
+
span: ::Array[Integer],
|
|
580
|
+
entity_type: String,
|
|
581
|
+
reasons: ::Array[String],
|
|
582
|
+
signals: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals
|
|
556
583
|
}
|
|
584
|
+
|
|
585
|
+
type signals =
|
|
586
|
+
{
|
|
587
|
+
bot_protection: bool?,
|
|
588
|
+
brand_impersonation: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation?,
|
|
589
|
+
domain_age_days: Integer?,
|
|
590
|
+
final_url: String?,
|
|
591
|
+
has_email_setup: bool?,
|
|
592
|
+
has_suspicious_characters: bool,
|
|
593
|
+
is_link_shortener: bool,
|
|
594
|
+
is_reported: bool,
|
|
595
|
+
redirect_count: Integer?
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
class Signals < ModerationAPI::Internal::Type::BaseModel
|
|
599
|
+
attr_accessor bot_protection: bool?
|
|
600
|
+
|
|
601
|
+
attr_accessor brand_impersonation: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation?
|
|
602
|
+
|
|
603
|
+
attr_accessor domain_age_days: Integer?
|
|
604
|
+
|
|
605
|
+
attr_accessor final_url: String?
|
|
606
|
+
|
|
607
|
+
attr_accessor has_email_setup: bool?
|
|
608
|
+
|
|
609
|
+
attr_accessor has_suspicious_characters: bool
|
|
610
|
+
|
|
611
|
+
attr_accessor is_link_shortener: bool
|
|
612
|
+
|
|
613
|
+
attr_accessor is_reported: bool
|
|
614
|
+
|
|
615
|
+
attr_accessor redirect_count: Integer?
|
|
616
|
+
|
|
617
|
+
def initialize: (
|
|
618
|
+
bot_protection: bool?,
|
|
619
|
+
brand_impersonation: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation?,
|
|
620
|
+
domain_age_days: Integer?,
|
|
621
|
+
final_url: String?,
|
|
622
|
+
has_email_setup: bool?,
|
|
623
|
+
has_suspicious_characters: bool,
|
|
624
|
+
is_link_shortener: bool,
|
|
625
|
+
is_reported: bool,
|
|
626
|
+
redirect_count: Integer?
|
|
627
|
+
) -> void
|
|
628
|
+
|
|
629
|
+
def to_hash: -> {
|
|
630
|
+
bot_protection: bool?,
|
|
631
|
+
brand_impersonation: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation?,
|
|
632
|
+
domain_age_days: Integer?,
|
|
633
|
+
final_url: String?,
|
|
634
|
+
has_email_setup: bool?,
|
|
635
|
+
has_suspicious_characters: bool,
|
|
636
|
+
is_link_shortener: bool,
|
|
637
|
+
is_reported: bool,
|
|
638
|
+
redirect_count: Integer?
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
type brand_impersonation =
|
|
642
|
+
{
|
|
643
|
+
brand: String,
|
|
644
|
+
method_: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel
|
|
648
|
+
attr_accessor brand: String
|
|
649
|
+
|
|
650
|
+
attr_accessor method_: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_
|
|
651
|
+
|
|
652
|
+
def initialize: (
|
|
653
|
+
brand: String,
|
|
654
|
+
method_: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_
|
|
655
|
+
) -> void
|
|
656
|
+
|
|
657
|
+
def to_hash: -> {
|
|
658
|
+
brand: String,
|
|
659
|
+
method_: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
type method_ = :registered_domain_token | :subdomain_token
|
|
663
|
+
|
|
664
|
+
module Method
|
|
665
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
666
|
+
|
|
667
|
+
REGISTERED_DOMAIN_TOKEN: :registered_domain_token
|
|
668
|
+
SUBDOMAIN_TOKEN: :subdomain_token
|
|
669
|
+
|
|
670
|
+
def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_]
|
|
671
|
+
end
|
|
672
|
+
end
|
|
673
|
+
end
|
|
557
674
|
end
|
|
558
675
|
end
|
|
559
676
|
|
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.
|
|
4
|
+
version: 2.12.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-
|
|
11
|
+
date: 2026-04-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|