moderation_api 2.2.1 → 2.4.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 +22 -0
- data/README.md +1 -1
- data/lib/moderation_api/models/content_submit_params.rb +59 -74
- data/lib/moderation_api/resources/content.rb +4 -2
- data/lib/moderation_api/version.rb +1 -1
- data/rbi/moderation_api/models/content_submit_params.rbi +92 -180
- data/rbi/moderation_api/resources/content.rbi +5 -0
- data/sig/moderation_api/models/content_submit_params.rbs +59 -93
- data/sig/moderation_api/resources/content.rbs +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f1b69f757e3da0801ba5b2d3c7aa6c0574e50d46e6cfa5d425f6b0aab262d126
|
|
4
|
+
data.tar.gz: e521e2d93df65cbadd921d998de6b79985d97332cc6adc9329cc440698daaa27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1801b13713e8a812251a2305457363607a8725426dfb0d6769575a8e954be163101cf03a2f1fe27ce0542c421c2c66ec7406a93305482f5b6b8e71ff125f014
|
|
7
|
+
data.tar.gz: dbc35cd9eb0aa0419b5e91b7fc7297bcbcd83eafd924656ceb1d4a55c32933d2ad19d68f9070f04a87b8c70c2ab71e083c840472740793abce07c6f1d0b74d94
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.4.0 (2026-01-28)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.3.0...v2.4.0](https://github.com/moderation-api/sdk-ruby/compare/v2.3.0...v2.4.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([6f59d50](https://github.com/moderation-api/sdk-ruby/commit/6f59d503d5316ea4989dc7f2826a760599a9cc0d))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **internal:** update `actions/checkout` version ([6debb55](https://github.com/moderation-api/sdk-ruby/commit/6debb5528f54ceaefc72ffa445a69aa4f30bc4e7))
|
|
15
|
+
* move `cgi` into dependencies for ruby 4 ([6aab585](https://github.com/moderation-api/sdk-ruby/commit/6aab585a91f2ac47f2bae66f1e21d03eb6b5b475))
|
|
16
|
+
|
|
17
|
+
## 2.3.0 (2026-01-02)
|
|
18
|
+
|
|
19
|
+
Full Changelog: [v2.2.1...v2.3.0](https://github.com/moderation-api/sdk-ruby/compare/v2.2.1...v2.3.0)
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **api:** api update ([b7e4375](https://github.com/moderation-api/sdk-ruby/commit/b7e4375b627d949a7e9ac5794703793c9da54415))
|
|
24
|
+
|
|
3
25
|
## 2.2.1 (2025-12-19)
|
|
4
26
|
|
|
5
27
|
Full Changelog: [v2.2.0...v2.2.1](https://github.com/moderation-api/sdk-ruby/compare/v2.2.0...v2.2.1)
|
data/README.md
CHANGED
|
@@ -59,11 +59,18 @@ module ModerationAPI
|
|
|
59
59
|
# @!attribute policies
|
|
60
60
|
# (Enterprise) override the channel policies for this moderation request only.
|
|
61
61
|
#
|
|
62
|
-
# @return [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>, nil]
|
|
62
|
+
# @return [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>, nil]
|
|
63
63
|
optional :policies,
|
|
64
64
|
-> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::ContentSubmitParams::Policy] }
|
|
65
65
|
|
|
66
|
-
# @!
|
|
66
|
+
# @!attribute timestamp
|
|
67
|
+
# Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
68
|
+
# is not submitted in real-time.
|
|
69
|
+
#
|
|
70
|
+
# @return [Float, nil]
|
|
71
|
+
optional :timestamp, Float
|
|
72
|
+
|
|
73
|
+
# @!method initialize(content:, author_id: nil, channel: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {})
|
|
67
74
|
# Some parameter documentations has been truncated, see
|
|
68
75
|
# {ModerationAPI::Models::ContentSubmitParams} for more details.
|
|
69
76
|
#
|
|
@@ -83,7 +90,9 @@ module ModerationAPI
|
|
|
83
90
|
#
|
|
84
91
|
# @param meta_type [Symbol, ModerationAPI::Models::ContentSubmitParams::MetaType] The meta type of content being moderated
|
|
85
92
|
#
|
|
86
|
-
# @param policies [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>] (Enterprise) override the channel policies for this moderation request only.
|
|
93
|
+
# @param policies [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>] (Enterprise) override the channel policies for this moderation request only.
|
|
94
|
+
#
|
|
95
|
+
# @param timestamp [Float] Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
87
96
|
#
|
|
88
97
|
# @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
89
98
|
|
|
@@ -351,6 +360,8 @@ module ModerationAPI
|
|
|
351
360
|
|
|
352
361
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::IllicitGambling }
|
|
353
362
|
|
|
363
|
+
variant -> { ModerationAPI::ContentSubmitParams::Policy::Cannabis }
|
|
364
|
+
|
|
354
365
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::Sexual }
|
|
355
366
|
|
|
356
367
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::Flirtation }
|
|
@@ -597,6 +608,28 @@ module ModerationAPI
|
|
|
597
608
|
# @param id [Symbol, :illicit_gambling]
|
|
598
609
|
end
|
|
599
610
|
|
|
611
|
+
class Cannabis < ModerationAPI::Internal::Type::BaseModel
|
|
612
|
+
# @!attribute id
|
|
613
|
+
#
|
|
614
|
+
# @return [Symbol, :cannabis]
|
|
615
|
+
required :id, const: :cannabis
|
|
616
|
+
|
|
617
|
+
# @!attribute flag
|
|
618
|
+
#
|
|
619
|
+
# @return [Boolean]
|
|
620
|
+
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
621
|
+
|
|
622
|
+
# @!attribute threshold
|
|
623
|
+
#
|
|
624
|
+
# @return [Float, nil]
|
|
625
|
+
optional :threshold, Float
|
|
626
|
+
|
|
627
|
+
# @!method initialize(flag:, threshold: nil, id: :cannabis)
|
|
628
|
+
# @param flag [Boolean]
|
|
629
|
+
# @param threshold [Float]
|
|
630
|
+
# @param id [Symbol, :cannabis]
|
|
631
|
+
end
|
|
632
|
+
|
|
600
633
|
class Sexual < ModerationAPI::Internal::Type::BaseModel
|
|
601
634
|
# @!attribute id
|
|
602
635
|
#
|
|
@@ -834,55 +867,31 @@ module ModerationAPI
|
|
|
834
867
|
# @param id [Symbol, :pii]
|
|
835
868
|
|
|
836
869
|
class Entity < ModerationAPI::Internal::Type::BaseModel
|
|
837
|
-
# @!attribute id
|
|
838
|
-
#
|
|
839
|
-
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::ID]
|
|
840
|
-
required :id, enum: -> { ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID }
|
|
841
|
-
|
|
842
870
|
# @!attribute enable
|
|
843
871
|
#
|
|
844
|
-
# @return [Boolean]
|
|
845
|
-
|
|
872
|
+
# @return [Boolean, nil]
|
|
873
|
+
optional :enable, ModerationAPI::Internal::Type::Boolean
|
|
846
874
|
|
|
847
875
|
# @!attribute flag
|
|
848
876
|
#
|
|
849
|
-
# @return [Boolean]
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
# @!attribute should_mask
|
|
853
|
-
#
|
|
854
|
-
# @return [Boolean]
|
|
855
|
-
required :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask
|
|
877
|
+
# @return [Boolean, nil]
|
|
878
|
+
optional :flag, ModerationAPI::Internal::Type::Boolean
|
|
856
879
|
|
|
857
880
|
# @!attribute mask
|
|
858
881
|
#
|
|
859
882
|
# @return [String, nil]
|
|
860
883
|
optional :mask, String
|
|
861
884
|
|
|
862
|
-
# @!
|
|
863
|
-
#
|
|
885
|
+
# @!attribute should_mask
|
|
886
|
+
#
|
|
887
|
+
# @return [Boolean, nil]
|
|
888
|
+
optional :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask
|
|
889
|
+
|
|
890
|
+
# @!method initialize(enable: nil, flag: nil, mask: nil, should_mask: nil)
|
|
864
891
|
# @param enable [Boolean]
|
|
865
892
|
# @param flag [Boolean]
|
|
866
|
-
# @param should_mask [Boolean]
|
|
867
893
|
# @param mask [String]
|
|
868
|
-
|
|
869
|
-
# @see ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity#id
|
|
870
|
-
module ID
|
|
871
|
-
extend ModerationAPI::Internal::Type::Enum
|
|
872
|
-
|
|
873
|
-
EMAIL = :email
|
|
874
|
-
PHONE = :phone
|
|
875
|
-
URL = :url
|
|
876
|
-
ADDRESS = :address
|
|
877
|
-
NAME = :name
|
|
878
|
-
USERNAME = :username
|
|
879
|
-
IP_ADDRESS = :ip_address
|
|
880
|
-
CREDIT_CARD = :credit_card
|
|
881
|
-
SENSITIVE_OTHER = :sensitive_other
|
|
882
|
-
|
|
883
|
-
# @!method self.values
|
|
884
|
-
# @return [Array<Symbol>]
|
|
885
|
-
end
|
|
894
|
+
# @param should_mask [Boolean]
|
|
886
895
|
end
|
|
887
896
|
end
|
|
888
897
|
|
|
@@ -903,55 +912,31 @@ module ModerationAPI
|
|
|
903
912
|
# @param id [Symbol, :url]
|
|
904
913
|
|
|
905
914
|
class Entity < ModerationAPI::Internal::Type::BaseModel
|
|
906
|
-
# @!attribute id
|
|
907
|
-
#
|
|
908
|
-
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::ID]
|
|
909
|
-
required :id, enum: -> { ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID }
|
|
910
|
-
|
|
911
915
|
# @!attribute enable
|
|
912
916
|
#
|
|
913
|
-
# @return [Boolean]
|
|
914
|
-
|
|
917
|
+
# @return [Boolean, nil]
|
|
918
|
+
optional :enable, ModerationAPI::Internal::Type::Boolean
|
|
915
919
|
|
|
916
920
|
# @!attribute flag
|
|
917
921
|
#
|
|
918
|
-
# @return [Boolean]
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
# @!attribute should_mask
|
|
922
|
-
#
|
|
923
|
-
# @return [Boolean]
|
|
924
|
-
required :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask
|
|
922
|
+
# @return [Boolean, nil]
|
|
923
|
+
optional :flag, ModerationAPI::Internal::Type::Boolean
|
|
925
924
|
|
|
926
925
|
# @!attribute mask
|
|
927
926
|
#
|
|
928
927
|
# @return [String, nil]
|
|
929
928
|
optional :mask, String
|
|
930
929
|
|
|
931
|
-
# @!
|
|
932
|
-
#
|
|
930
|
+
# @!attribute should_mask
|
|
931
|
+
#
|
|
932
|
+
# @return [Boolean, nil]
|
|
933
|
+
optional :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask
|
|
934
|
+
|
|
935
|
+
# @!method initialize(enable: nil, flag: nil, mask: nil, should_mask: nil)
|
|
933
936
|
# @param enable [Boolean]
|
|
934
937
|
# @param flag [Boolean]
|
|
935
|
-
# @param should_mask [Boolean]
|
|
936
938
|
# @param mask [String]
|
|
937
|
-
|
|
938
|
-
# @see ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity#id
|
|
939
|
-
module ID
|
|
940
|
-
extend ModerationAPI::Internal::Type::Enum
|
|
941
|
-
|
|
942
|
-
EMAIL = :email
|
|
943
|
-
PHONE = :phone
|
|
944
|
-
URL = :url
|
|
945
|
-
ADDRESS = :address
|
|
946
|
-
NAME = :name
|
|
947
|
-
USERNAME = :username
|
|
948
|
-
IP_ADDRESS = :ip_address
|
|
949
|
-
CREDIT_CARD = :credit_card
|
|
950
|
-
SENSITIVE_OTHER = :sensitive_other
|
|
951
|
-
|
|
952
|
-
# @!method self.values
|
|
953
|
-
# @return [Array<Symbol>]
|
|
954
|
-
end
|
|
939
|
+
# @param should_mask [Boolean]
|
|
955
940
|
end
|
|
956
941
|
end
|
|
957
942
|
|
|
@@ -990,7 +975,7 @@ module ModerationAPI
|
|
|
990
975
|
end
|
|
991
976
|
|
|
992
977
|
# @!method self.variants
|
|
993
|
-
# @return [Array(ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline)]
|
|
978
|
+
# @return [Array(ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline)]
|
|
994
979
|
end
|
|
995
980
|
end
|
|
996
981
|
end
|
|
@@ -6,7 +6,7 @@ module ModerationAPI
|
|
|
6
6
|
# Some parameter documentations has been truncated, see
|
|
7
7
|
# {ModerationAPI::Models::ContentSubmitParams} for more details.
|
|
8
8
|
#
|
|
9
|
-
# @overload submit(content:, author_id: nil, channel: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, request_options: {})
|
|
9
|
+
# @overload submit(content:, author_id: nil, channel: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {})
|
|
10
10
|
#
|
|
11
11
|
# @param content [ModerationAPI::Models::ContentSubmitParams::Content::Text, ModerationAPI::Models::ContentSubmitParams::Content::Image, ModerationAPI::Models::ContentSubmitParams::Content::Video, ModerationAPI::Models::ContentSubmitParams::Content::Audio, ModerationAPI::Models::ContentSubmitParams::Content::Object] The content sent for moderation
|
|
12
12
|
#
|
|
@@ -24,7 +24,9 @@ module ModerationAPI
|
|
|
24
24
|
#
|
|
25
25
|
# @param meta_type [Symbol, ModerationAPI::Models::ContentSubmitParams::MetaType] The meta type of content being moderated
|
|
26
26
|
#
|
|
27
|
-
# @param policies [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>] (Enterprise) override the channel policies for this moderation request only.
|
|
27
|
+
# @param policies [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>] (Enterprise) override the channel policies for this moderation request only.
|
|
28
|
+
#
|
|
29
|
+
# @param timestamp [Float] Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
28
30
|
#
|
|
29
31
|
# @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
30
32
|
#
|
|
@@ -102,6 +102,7 @@ module ModerationAPI
|
|
|
102
102
|
ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms,
|
|
103
103
|
ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco,
|
|
104
104
|
ModerationAPI::ContentSubmitParams::Policy::IllicitGambling,
|
|
105
|
+
ModerationAPI::ContentSubmitParams::Policy::Cannabis,
|
|
105
106
|
ModerationAPI::ContentSubmitParams::Policy::Sexual,
|
|
106
107
|
ModerationAPI::ContentSubmitParams::Policy::Flirtation,
|
|
107
108
|
ModerationAPI::ContentSubmitParams::Policy::Profanity,
|
|
@@ -137,6 +138,7 @@ module ModerationAPI
|
|
|
137
138
|
ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms::OrHash,
|
|
138
139
|
ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco::OrHash,
|
|
139
140
|
ModerationAPI::ContentSubmitParams::Policy::IllicitGambling::OrHash,
|
|
141
|
+
ModerationAPI::ContentSubmitParams::Policy::Cannabis::OrHash,
|
|
140
142
|
ModerationAPI::ContentSubmitParams::Policy::Sexual::OrHash,
|
|
141
143
|
ModerationAPI::ContentSubmitParams::Policy::Flirtation::OrHash,
|
|
142
144
|
ModerationAPI::ContentSubmitParams::Policy::Profanity::OrHash,
|
|
@@ -156,6 +158,14 @@ module ModerationAPI
|
|
|
156
158
|
end
|
|
157
159
|
attr_writer :policies
|
|
158
160
|
|
|
161
|
+
# Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
162
|
+
# is not submitted in real-time.
|
|
163
|
+
sig { returns(T.nilable(Float)) }
|
|
164
|
+
attr_reader :timestamp
|
|
165
|
+
|
|
166
|
+
sig { params(timestamp: Float).void }
|
|
167
|
+
attr_writer :timestamp
|
|
168
|
+
|
|
159
169
|
sig do
|
|
160
170
|
params(
|
|
161
171
|
content:
|
|
@@ -186,6 +196,7 @@ module ModerationAPI
|
|
|
186
196
|
ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms::OrHash,
|
|
187
197
|
ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco::OrHash,
|
|
188
198
|
ModerationAPI::ContentSubmitParams::Policy::IllicitGambling::OrHash,
|
|
199
|
+
ModerationAPI::ContentSubmitParams::Policy::Cannabis::OrHash,
|
|
189
200
|
ModerationAPI::ContentSubmitParams::Policy::Sexual::OrHash,
|
|
190
201
|
ModerationAPI::ContentSubmitParams::Policy::Flirtation::OrHash,
|
|
191
202
|
ModerationAPI::ContentSubmitParams::Policy::Profanity::OrHash,
|
|
@@ -201,6 +212,7 @@ module ModerationAPI
|
|
|
201
212
|
ModerationAPI::ContentSubmitParams::Policy::Guideline::OrHash
|
|
202
213
|
)
|
|
203
214
|
],
|
|
215
|
+
timestamp: Float,
|
|
204
216
|
request_options: ModerationAPI::RequestOptions::OrHash
|
|
205
217
|
).returns(T.attached_class)
|
|
206
218
|
end
|
|
@@ -224,6 +236,9 @@ module ModerationAPI
|
|
|
224
236
|
meta_type: nil,
|
|
225
237
|
# (Enterprise) override the channel policies for this moderation request only.
|
|
226
238
|
policies: nil,
|
|
239
|
+
# Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
240
|
+
# is not submitted in real-time.
|
|
241
|
+
timestamp: nil,
|
|
227
242
|
request_options: {}
|
|
228
243
|
)
|
|
229
244
|
end
|
|
@@ -259,6 +274,7 @@ module ModerationAPI
|
|
|
259
274
|
ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms,
|
|
260
275
|
ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco,
|
|
261
276
|
ModerationAPI::ContentSubmitParams::Policy::IllicitGambling,
|
|
277
|
+
ModerationAPI::ContentSubmitParams::Policy::Cannabis,
|
|
262
278
|
ModerationAPI::ContentSubmitParams::Policy::Sexual,
|
|
263
279
|
ModerationAPI::ContentSubmitParams::Policy::Flirtation,
|
|
264
280
|
ModerationAPI::ContentSubmitParams::Policy::Profanity,
|
|
@@ -274,6 +290,7 @@ module ModerationAPI
|
|
|
274
290
|
ModerationAPI::ContentSubmitParams::Policy::Guideline
|
|
275
291
|
)
|
|
276
292
|
],
|
|
293
|
+
timestamp: Float,
|
|
277
294
|
request_options: ModerationAPI::RequestOptions
|
|
278
295
|
}
|
|
279
296
|
)
|
|
@@ -726,6 +743,7 @@ module ModerationAPI
|
|
|
726
743
|
ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms,
|
|
727
744
|
ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco,
|
|
728
745
|
ModerationAPI::ContentSubmitParams::Policy::IllicitGambling,
|
|
746
|
+
ModerationAPI::ContentSubmitParams::Policy::Cannabis,
|
|
729
747
|
ModerationAPI::ContentSubmitParams::Policy::Sexual,
|
|
730
748
|
ModerationAPI::ContentSubmitParams::Policy::Flirtation,
|
|
731
749
|
ModerationAPI::ContentSubmitParams::Policy::Profanity,
|
|
@@ -1102,6 +1120,42 @@ module ModerationAPI
|
|
|
1102
1120
|
end
|
|
1103
1121
|
end
|
|
1104
1122
|
|
|
1123
|
+
class Cannabis < ModerationAPI::Internal::Type::BaseModel
|
|
1124
|
+
OrHash =
|
|
1125
|
+
T.type_alias do
|
|
1126
|
+
T.any(
|
|
1127
|
+
ModerationAPI::ContentSubmitParams::Policy::Cannabis,
|
|
1128
|
+
ModerationAPI::Internal::AnyHash
|
|
1129
|
+
)
|
|
1130
|
+
end
|
|
1131
|
+
|
|
1132
|
+
sig { returns(Symbol) }
|
|
1133
|
+
attr_accessor :id
|
|
1134
|
+
|
|
1135
|
+
sig { returns(T::Boolean) }
|
|
1136
|
+
attr_accessor :flag
|
|
1137
|
+
|
|
1138
|
+
sig { returns(T.nilable(Float)) }
|
|
1139
|
+
attr_reader :threshold
|
|
1140
|
+
|
|
1141
|
+
sig { params(threshold: Float).void }
|
|
1142
|
+
attr_writer :threshold
|
|
1143
|
+
|
|
1144
|
+
sig do
|
|
1145
|
+
params(flag: T::Boolean, threshold: Float, id: Symbol).returns(
|
|
1146
|
+
T.attached_class
|
|
1147
|
+
)
|
|
1148
|
+
end
|
|
1149
|
+
def self.new(flag:, threshold: nil, id: :cannabis)
|
|
1150
|
+
end
|
|
1151
|
+
|
|
1152
|
+
sig do
|
|
1153
|
+
override.returns({ id: Symbol, flag: T::Boolean, threshold: Float })
|
|
1154
|
+
end
|
|
1155
|
+
def to_hash
|
|
1156
|
+
end
|
|
1157
|
+
end
|
|
1158
|
+
|
|
1105
1159
|
class Sexual < ModerationAPI::Internal::Type::BaseModel
|
|
1106
1160
|
OrHash =
|
|
1107
1161
|
T.type_alias do
|
|
@@ -1521,21 +1575,17 @@ module ModerationAPI
|
|
|
1521
1575
|
)
|
|
1522
1576
|
end
|
|
1523
1577
|
|
|
1524
|
-
sig
|
|
1525
|
-
|
|
1526
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::OrSymbol
|
|
1527
|
-
)
|
|
1528
|
-
end
|
|
1529
|
-
attr_accessor :id
|
|
1578
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1579
|
+
attr_reader :enable
|
|
1530
1580
|
|
|
1531
|
-
sig {
|
|
1532
|
-
|
|
1581
|
+
sig { params(enable: T::Boolean).void }
|
|
1582
|
+
attr_writer :enable
|
|
1533
1583
|
|
|
1534
|
-
sig { returns(T::Boolean) }
|
|
1535
|
-
|
|
1584
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1585
|
+
attr_reader :flag
|
|
1536
1586
|
|
|
1537
|
-
sig {
|
|
1538
|
-
|
|
1587
|
+
sig { params(flag: T::Boolean).void }
|
|
1588
|
+
attr_writer :flag
|
|
1539
1589
|
|
|
1540
1590
|
sig { returns(T.nilable(String)) }
|
|
1541
1591
|
attr_reader :mask
|
|
@@ -1543,102 +1593,35 @@ module ModerationAPI
|
|
|
1543
1593
|
sig { params(mask: String).void }
|
|
1544
1594
|
attr_writer :mask
|
|
1545
1595
|
|
|
1596
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1597
|
+
attr_reader :should_mask
|
|
1598
|
+
|
|
1599
|
+
sig { params(should_mask: T::Boolean).void }
|
|
1600
|
+
attr_writer :should_mask
|
|
1601
|
+
|
|
1546
1602
|
sig do
|
|
1547
1603
|
params(
|
|
1548
|
-
id:
|
|
1549
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::OrSymbol,
|
|
1550
1604
|
enable: T::Boolean,
|
|
1551
1605
|
flag: T::Boolean,
|
|
1552
|
-
|
|
1553
|
-
|
|
1606
|
+
mask: String,
|
|
1607
|
+
should_mask: T::Boolean
|
|
1554
1608
|
).returns(T.attached_class)
|
|
1555
1609
|
end
|
|
1556
|
-
def self.new(
|
|
1610
|
+
def self.new(enable: nil, flag: nil, mask: nil, should_mask: nil)
|
|
1557
1611
|
end
|
|
1558
1612
|
|
|
1559
1613
|
sig do
|
|
1560
1614
|
override.returns(
|
|
1561
1615
|
{
|
|
1562
|
-
id:
|
|
1563
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::OrSymbol,
|
|
1564
1616
|
enable: T::Boolean,
|
|
1565
1617
|
flag: T::Boolean,
|
|
1566
|
-
|
|
1567
|
-
|
|
1618
|
+
mask: String,
|
|
1619
|
+
should_mask: T::Boolean
|
|
1568
1620
|
}
|
|
1569
1621
|
)
|
|
1570
1622
|
end
|
|
1571
1623
|
def to_hash
|
|
1572
1624
|
end
|
|
1573
|
-
|
|
1574
|
-
module ID
|
|
1575
|
-
extend ModerationAPI::Internal::Type::Enum
|
|
1576
|
-
|
|
1577
|
-
TaggedSymbol =
|
|
1578
|
-
T.type_alias do
|
|
1579
|
-
T.all(
|
|
1580
|
-
Symbol,
|
|
1581
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID
|
|
1582
|
-
)
|
|
1583
|
-
end
|
|
1584
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1585
|
-
|
|
1586
|
-
EMAIL =
|
|
1587
|
-
T.let(
|
|
1588
|
-
:email,
|
|
1589
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1590
|
-
)
|
|
1591
|
-
PHONE =
|
|
1592
|
-
T.let(
|
|
1593
|
-
:phone,
|
|
1594
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1595
|
-
)
|
|
1596
|
-
URL =
|
|
1597
|
-
T.let(
|
|
1598
|
-
:url,
|
|
1599
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1600
|
-
)
|
|
1601
|
-
ADDRESS =
|
|
1602
|
-
T.let(
|
|
1603
|
-
:address,
|
|
1604
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1605
|
-
)
|
|
1606
|
-
NAME =
|
|
1607
|
-
T.let(
|
|
1608
|
-
:name,
|
|
1609
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1610
|
-
)
|
|
1611
|
-
USERNAME =
|
|
1612
|
-
T.let(
|
|
1613
|
-
:username,
|
|
1614
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1615
|
-
)
|
|
1616
|
-
IP_ADDRESS =
|
|
1617
|
-
T.let(
|
|
1618
|
-
:ip_address,
|
|
1619
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1620
|
-
)
|
|
1621
|
-
CREDIT_CARD =
|
|
1622
|
-
T.let(
|
|
1623
|
-
:credit_card,
|
|
1624
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1625
|
-
)
|
|
1626
|
-
SENSITIVE_OTHER =
|
|
1627
|
-
T.let(
|
|
1628
|
-
:sensitive_other,
|
|
1629
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1630
|
-
)
|
|
1631
|
-
|
|
1632
|
-
sig do
|
|
1633
|
-
override.returns(
|
|
1634
|
-
T::Array[
|
|
1635
|
-
ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol
|
|
1636
|
-
]
|
|
1637
|
-
)
|
|
1638
|
-
end
|
|
1639
|
-
def self.values
|
|
1640
|
-
end
|
|
1641
|
-
end
|
|
1642
1625
|
end
|
|
1643
1626
|
end
|
|
1644
1627
|
|
|
@@ -1701,21 +1684,17 @@ module ModerationAPI
|
|
|
1701
1684
|
)
|
|
1702
1685
|
end
|
|
1703
1686
|
|
|
1704
|
-
sig
|
|
1705
|
-
|
|
1706
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::OrSymbol
|
|
1707
|
-
)
|
|
1708
|
-
end
|
|
1709
|
-
attr_accessor :id
|
|
1687
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1688
|
+
attr_reader :enable
|
|
1710
1689
|
|
|
1711
|
-
sig {
|
|
1712
|
-
|
|
1690
|
+
sig { params(enable: T::Boolean).void }
|
|
1691
|
+
attr_writer :enable
|
|
1713
1692
|
|
|
1714
|
-
sig { returns(T::Boolean) }
|
|
1715
|
-
|
|
1693
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1694
|
+
attr_reader :flag
|
|
1716
1695
|
|
|
1717
|
-
sig {
|
|
1718
|
-
|
|
1696
|
+
sig { params(flag: T::Boolean).void }
|
|
1697
|
+
attr_writer :flag
|
|
1719
1698
|
|
|
1720
1699
|
sig { returns(T.nilable(String)) }
|
|
1721
1700
|
attr_reader :mask
|
|
@@ -1723,102 +1702,35 @@ module ModerationAPI
|
|
|
1723
1702
|
sig { params(mask: String).void }
|
|
1724
1703
|
attr_writer :mask
|
|
1725
1704
|
|
|
1705
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
1706
|
+
attr_reader :should_mask
|
|
1707
|
+
|
|
1708
|
+
sig { params(should_mask: T::Boolean).void }
|
|
1709
|
+
attr_writer :should_mask
|
|
1710
|
+
|
|
1726
1711
|
sig do
|
|
1727
1712
|
params(
|
|
1728
|
-
id:
|
|
1729
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::OrSymbol,
|
|
1730
1713
|
enable: T::Boolean,
|
|
1731
1714
|
flag: T::Boolean,
|
|
1732
|
-
|
|
1733
|
-
|
|
1715
|
+
mask: String,
|
|
1716
|
+
should_mask: T::Boolean
|
|
1734
1717
|
).returns(T.attached_class)
|
|
1735
1718
|
end
|
|
1736
|
-
def self.new(
|
|
1719
|
+
def self.new(enable: nil, flag: nil, mask: nil, should_mask: nil)
|
|
1737
1720
|
end
|
|
1738
1721
|
|
|
1739
1722
|
sig do
|
|
1740
1723
|
override.returns(
|
|
1741
1724
|
{
|
|
1742
|
-
id:
|
|
1743
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::OrSymbol,
|
|
1744
1725
|
enable: T::Boolean,
|
|
1745
1726
|
flag: T::Boolean,
|
|
1746
|
-
|
|
1747
|
-
|
|
1727
|
+
mask: String,
|
|
1728
|
+
should_mask: T::Boolean
|
|
1748
1729
|
}
|
|
1749
1730
|
)
|
|
1750
1731
|
end
|
|
1751
1732
|
def to_hash
|
|
1752
1733
|
end
|
|
1753
|
-
|
|
1754
|
-
module ID
|
|
1755
|
-
extend ModerationAPI::Internal::Type::Enum
|
|
1756
|
-
|
|
1757
|
-
TaggedSymbol =
|
|
1758
|
-
T.type_alias do
|
|
1759
|
-
T.all(
|
|
1760
|
-
Symbol,
|
|
1761
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID
|
|
1762
|
-
)
|
|
1763
|
-
end
|
|
1764
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1765
|
-
|
|
1766
|
-
EMAIL =
|
|
1767
|
-
T.let(
|
|
1768
|
-
:email,
|
|
1769
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1770
|
-
)
|
|
1771
|
-
PHONE =
|
|
1772
|
-
T.let(
|
|
1773
|
-
:phone,
|
|
1774
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1775
|
-
)
|
|
1776
|
-
URL =
|
|
1777
|
-
T.let(
|
|
1778
|
-
:url,
|
|
1779
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1780
|
-
)
|
|
1781
|
-
ADDRESS =
|
|
1782
|
-
T.let(
|
|
1783
|
-
:address,
|
|
1784
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1785
|
-
)
|
|
1786
|
-
NAME =
|
|
1787
|
-
T.let(
|
|
1788
|
-
:name,
|
|
1789
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1790
|
-
)
|
|
1791
|
-
USERNAME =
|
|
1792
|
-
T.let(
|
|
1793
|
-
:username,
|
|
1794
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1795
|
-
)
|
|
1796
|
-
IP_ADDRESS =
|
|
1797
|
-
T.let(
|
|
1798
|
-
:ip_address,
|
|
1799
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1800
|
-
)
|
|
1801
|
-
CREDIT_CARD =
|
|
1802
|
-
T.let(
|
|
1803
|
-
:credit_card,
|
|
1804
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1805
|
-
)
|
|
1806
|
-
SENSITIVE_OTHER =
|
|
1807
|
-
T.let(
|
|
1808
|
-
:sensitive_other,
|
|
1809
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1810
|
-
)
|
|
1811
|
-
|
|
1812
|
-
sig do
|
|
1813
|
-
override.returns(
|
|
1814
|
-
T::Array[
|
|
1815
|
-
ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol
|
|
1816
|
-
]
|
|
1817
|
-
)
|
|
1818
|
-
end
|
|
1819
|
-
def self.values
|
|
1820
|
-
end
|
|
1821
|
-
end
|
|
1822
1734
|
end
|
|
1823
1735
|
end
|
|
1824
1736
|
|
|
@@ -33,6 +33,7 @@ module ModerationAPI
|
|
|
33
33
|
ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms::OrHash,
|
|
34
34
|
ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco::OrHash,
|
|
35
35
|
ModerationAPI::ContentSubmitParams::Policy::IllicitGambling::OrHash,
|
|
36
|
+
ModerationAPI::ContentSubmitParams::Policy::Cannabis::OrHash,
|
|
36
37
|
ModerationAPI::ContentSubmitParams::Policy::Sexual::OrHash,
|
|
37
38
|
ModerationAPI::ContentSubmitParams::Policy::Flirtation::OrHash,
|
|
38
39
|
ModerationAPI::ContentSubmitParams::Policy::Profanity::OrHash,
|
|
@@ -48,6 +49,7 @@ module ModerationAPI
|
|
|
48
49
|
ModerationAPI::ContentSubmitParams::Policy::Guideline::OrHash
|
|
49
50
|
)
|
|
50
51
|
],
|
|
52
|
+
timestamp: Float,
|
|
51
53
|
request_options: ModerationAPI::RequestOptions::OrHash
|
|
52
54
|
).returns(ModerationAPI::Models::ContentSubmitResponse)
|
|
53
55
|
end
|
|
@@ -71,6 +73,9 @@ module ModerationAPI
|
|
|
71
73
|
meta_type: nil,
|
|
72
74
|
# (Enterprise) override the channel policies for this moderation request only.
|
|
73
75
|
policies: nil,
|
|
76
|
+
# Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
77
|
+
# is not submitted in real-time.
|
|
78
|
+
timestamp: nil,
|
|
74
79
|
request_options: {}
|
|
75
80
|
)
|
|
76
81
|
end
|
|
@@ -10,7 +10,8 @@ module ModerationAPI
|
|
|
10
10
|
do_not_store: bool,
|
|
11
11
|
metadata: ::Hash[Symbol, top],
|
|
12
12
|
meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type,
|
|
13
|
-
policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy]
|
|
13
|
+
policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy],
|
|
14
|
+
timestamp: Float
|
|
14
15
|
}
|
|
15
16
|
& ModerationAPI::Internal::Type::request_parameters
|
|
16
17
|
|
|
@@ -56,6 +57,10 @@ module ModerationAPI
|
|
|
56
57
|
::Array[ModerationAPI::Models::ContentSubmitParams::policy]
|
|
57
58
|
) -> ::Array[ModerationAPI::Models::ContentSubmitParams::policy]
|
|
58
59
|
|
|
60
|
+
attr_reader timestamp: Float?
|
|
61
|
+
|
|
62
|
+
def timestamp=: (Float) -> Float
|
|
63
|
+
|
|
59
64
|
def initialize: (
|
|
60
65
|
content: ModerationAPI::Models::ContentSubmitParams::content,
|
|
61
66
|
?author_id: String,
|
|
@@ -66,6 +71,7 @@ module ModerationAPI
|
|
|
66
71
|
?metadata: ::Hash[Symbol, top],
|
|
67
72
|
?meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type,
|
|
68
73
|
?policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy],
|
|
74
|
+
?timestamp: Float,
|
|
69
75
|
?request_options: ModerationAPI::request_opts
|
|
70
76
|
) -> void
|
|
71
77
|
|
|
@@ -79,6 +85,7 @@ module ModerationAPI
|
|
|
79
85
|
metadata: ::Hash[Symbol, top],
|
|
80
86
|
meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type,
|
|
81
87
|
policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy],
|
|
88
|
+
timestamp: Float,
|
|
82
89
|
request_options: ModerationAPI::RequestOptions
|
|
83
90
|
}
|
|
84
91
|
|
|
@@ -261,6 +268,7 @@ module ModerationAPI
|
|
|
261
268
|
| ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms
|
|
262
269
|
| ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco
|
|
263
270
|
| ModerationAPI::ContentSubmitParams::Policy::IllicitGambling
|
|
271
|
+
| ModerationAPI::ContentSubmitParams::Policy::Cannabis
|
|
264
272
|
| ModerationAPI::ContentSubmitParams::Policy::Sexual
|
|
265
273
|
| ModerationAPI::ContentSubmitParams::Policy::Flirtation
|
|
266
274
|
| ModerationAPI::ContentSubmitParams::Policy::Profanity
|
|
@@ -489,6 +497,26 @@ module ModerationAPI
|
|
|
489
497
|
}
|
|
490
498
|
end
|
|
491
499
|
|
|
500
|
+
type cannabis = { id: :cannabis, flag: bool, threshold: Float }
|
|
501
|
+
|
|
502
|
+
class Cannabis < ModerationAPI::Internal::Type::BaseModel
|
|
503
|
+
attr_accessor id: :cannabis
|
|
504
|
+
|
|
505
|
+
attr_accessor flag: bool
|
|
506
|
+
|
|
507
|
+
attr_reader threshold: Float?
|
|
508
|
+
|
|
509
|
+
def threshold=: (Float) -> Float
|
|
510
|
+
|
|
511
|
+
def initialize: (
|
|
512
|
+
flag: bool,
|
|
513
|
+
?threshold: Float,
|
|
514
|
+
?id: :cannabis
|
|
515
|
+
) -> void
|
|
516
|
+
|
|
517
|
+
def to_hash: -> { id: :cannabis, flag: bool, threshold: Float }
|
|
518
|
+
end
|
|
519
|
+
|
|
492
520
|
type sexual = { id: :sexual, flag: bool, threshold: Float }
|
|
493
521
|
|
|
494
522
|
class Sexual < ModerationAPI::Internal::Type::BaseModel
|
|
@@ -704,69 +732,38 @@ module ModerationAPI
|
|
|
704
732
|
}
|
|
705
733
|
|
|
706
734
|
type entity =
|
|
707
|
-
{
|
|
708
|
-
id: ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::id,
|
|
709
|
-
enable: bool,
|
|
710
|
-
flag: bool,
|
|
711
|
-
should_mask: bool,
|
|
712
|
-
mask: String
|
|
713
|
-
}
|
|
735
|
+
{ enable: bool, flag: bool, mask: String, should_mask: bool }
|
|
714
736
|
|
|
715
737
|
class Entity < ModerationAPI::Internal::Type::BaseModel
|
|
716
|
-
|
|
738
|
+
attr_reader enable: bool?
|
|
717
739
|
|
|
718
|
-
|
|
740
|
+
def enable=: (bool) -> bool
|
|
719
741
|
|
|
720
|
-
|
|
742
|
+
attr_reader flag: bool?
|
|
721
743
|
|
|
722
|
-
|
|
744
|
+
def flag=: (bool) -> bool
|
|
723
745
|
|
|
724
746
|
attr_reader mask: String?
|
|
725
747
|
|
|
726
748
|
def mask=: (String) -> String
|
|
727
749
|
|
|
750
|
+
attr_reader should_mask: bool?
|
|
751
|
+
|
|
752
|
+
def should_mask=: (bool) -> bool
|
|
753
|
+
|
|
728
754
|
def initialize: (
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
should_mask: bool
|
|
733
|
-
?mask: String
|
|
755
|
+
?enable: bool,
|
|
756
|
+
?flag: bool,
|
|
757
|
+
?mask: String,
|
|
758
|
+
?should_mask: bool
|
|
734
759
|
) -> void
|
|
735
760
|
|
|
736
761
|
def to_hash: -> {
|
|
737
|
-
id: ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::id,
|
|
738
762
|
enable: bool,
|
|
739
763
|
flag: bool,
|
|
740
|
-
|
|
741
|
-
|
|
764
|
+
mask: String,
|
|
765
|
+
should_mask: bool
|
|
742
766
|
}
|
|
743
|
-
|
|
744
|
-
type id =
|
|
745
|
-
:email
|
|
746
|
-
| :phone
|
|
747
|
-
| :url
|
|
748
|
-
| :address
|
|
749
|
-
| :name
|
|
750
|
-
| :username
|
|
751
|
-
| :ip_address
|
|
752
|
-
| :credit_card
|
|
753
|
-
| :sensitive_other
|
|
754
|
-
|
|
755
|
-
module ID
|
|
756
|
-
extend ModerationAPI::Internal::Type::Enum
|
|
757
|
-
|
|
758
|
-
EMAIL: :email
|
|
759
|
-
PHONE: :phone
|
|
760
|
-
URL: :url
|
|
761
|
-
ADDRESS: :address
|
|
762
|
-
NAME: :name
|
|
763
|
-
USERNAME: :username
|
|
764
|
-
IP_ADDRESS: :ip_address
|
|
765
|
-
CREDIT_CARD: :credit_card
|
|
766
|
-
SENSITIVE_OTHER: :sensitive_other
|
|
767
|
-
|
|
768
|
-
def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::id]
|
|
769
|
-
end
|
|
770
767
|
end
|
|
771
768
|
end
|
|
772
769
|
|
|
@@ -792,69 +789,38 @@ module ModerationAPI
|
|
|
792
789
|
}
|
|
793
790
|
|
|
794
791
|
type entity =
|
|
795
|
-
{
|
|
796
|
-
id: ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::id,
|
|
797
|
-
enable: bool,
|
|
798
|
-
flag: bool,
|
|
799
|
-
should_mask: bool,
|
|
800
|
-
mask: String
|
|
801
|
-
}
|
|
792
|
+
{ enable: bool, flag: bool, mask: String, should_mask: bool }
|
|
802
793
|
|
|
803
794
|
class Entity < ModerationAPI::Internal::Type::BaseModel
|
|
804
|
-
|
|
795
|
+
attr_reader enable: bool?
|
|
805
796
|
|
|
806
|
-
|
|
797
|
+
def enable=: (bool) -> bool
|
|
807
798
|
|
|
808
|
-
|
|
799
|
+
attr_reader flag: bool?
|
|
809
800
|
|
|
810
|
-
|
|
801
|
+
def flag=: (bool) -> bool
|
|
811
802
|
|
|
812
803
|
attr_reader mask: String?
|
|
813
804
|
|
|
814
805
|
def mask=: (String) -> String
|
|
815
806
|
|
|
807
|
+
attr_reader should_mask: bool?
|
|
808
|
+
|
|
809
|
+
def should_mask=: (bool) -> bool
|
|
810
|
+
|
|
816
811
|
def initialize: (
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
should_mask: bool
|
|
821
|
-
?mask: String
|
|
812
|
+
?enable: bool,
|
|
813
|
+
?flag: bool,
|
|
814
|
+
?mask: String,
|
|
815
|
+
?should_mask: bool
|
|
822
816
|
) -> void
|
|
823
817
|
|
|
824
818
|
def to_hash: -> {
|
|
825
|
-
id: ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::id,
|
|
826
819
|
enable: bool,
|
|
827
820
|
flag: bool,
|
|
828
|
-
|
|
829
|
-
|
|
821
|
+
mask: String,
|
|
822
|
+
should_mask: bool
|
|
830
823
|
}
|
|
831
|
-
|
|
832
|
-
type id =
|
|
833
|
-
:email
|
|
834
|
-
| :phone
|
|
835
|
-
| :url
|
|
836
|
-
| :address
|
|
837
|
-
| :name
|
|
838
|
-
| :username
|
|
839
|
-
| :ip_address
|
|
840
|
-
| :credit_card
|
|
841
|
-
| :sensitive_other
|
|
842
|
-
|
|
843
|
-
module ID
|
|
844
|
-
extend ModerationAPI::Internal::Type::Enum
|
|
845
|
-
|
|
846
|
-
EMAIL: :email
|
|
847
|
-
PHONE: :phone
|
|
848
|
-
URL: :url
|
|
849
|
-
ADDRESS: :address
|
|
850
|
-
NAME: :name
|
|
851
|
-
USERNAME: :username
|
|
852
|
-
IP_ADDRESS: :ip_address
|
|
853
|
-
CREDIT_CARD: :credit_card
|
|
854
|
-
SENSITIVE_OTHER: :sensitive_other
|
|
855
|
-
|
|
856
|
-
def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::id]
|
|
857
|
-
end
|
|
858
824
|
end
|
|
859
825
|
end
|
|
860
826
|
|
|
@@ -11,6 +11,7 @@ module ModerationAPI
|
|
|
11
11
|
?metadata: ::Hash[Symbol, top],
|
|
12
12
|
?meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type,
|
|
13
13
|
?policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy],
|
|
14
|
+
?timestamp: Float,
|
|
14
15
|
?request_options: ModerationAPI::request_opts
|
|
15
16
|
) -> ModerationAPI::Models::ContentSubmitResponse
|
|
16
17
|
|
metadata
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moderation_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.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:
|
|
11
|
+
date: 2026-01-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: cgi
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
name: connection_pool
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|