moderation_api 3.4.0 → 3.6.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/lib/moderation_api/actions.rb +5 -5
- data/lib/moderation_api/channels.rb +9 -0
- data/lib/moderation_api/content.rb +1 -0
- data/lib/moderation_api/guidelines.rb +555 -0
- data/lib/moderation_api/models/components/badrequesterror_code.rb +2 -0
- data/lib/moderation_api/models/components/channel.rb +84 -2
- data/lib/moderation_api/models/components/channel.rbi +42 -0
- data/lib/moderation_api/models/components/channelguideline.rb +55 -0
- data/lib/moderation_api/models/components/channelguideline.rbi +32 -0
- data/lib/moderation_api/models/components/channelpolicy.rb +150 -0
- data/lib/moderation_api/models/components/channelpolicy.rbi +80 -0
- data/lib/moderation_api/models/components/channelpolicy_type.rb +24 -0
- data/lib/moderation_api/models/components/channelpolicy_type.rbi +9 -0
- data/lib/moderation_api/models/components/channelwordlist.rb +96 -0
- data/lib/moderation_api/models/components/channelwordlist.rbi +50 -0
- data/lib/moderation_api/models/components/channelwordlist_type.rb +22 -0
- data/lib/moderation_api/models/components/channelwordlist_type.rbi +9 -0
- data/lib/moderation_api/models/components/condition.rb +68 -0
- data/lib/moderation_api/models/components/condition.rbi +26 -0
- data/lib/moderation_api/models/components/format.rb +20 -0
- data/lib/moderation_api/models/components/format.rbi +9 -0
- data/lib/moderation_api/models/components/notfounderror_code.rb +6 -0
- data/lib/moderation_api/models/components/permissiondeniederror_code.rb +2 -0
- data/lib/moderation_api/models/components/rule.rb +150 -0
- data/lib/moderation_api/models/components/rule.rbi +80 -0
- data/lib/moderation_api/models/components/rule_action.rb +22 -0
- data/lib/moderation_api/models/components/rule_action.rbi +9 -0
- data/lib/moderation_api/models/components/rule_operator.rb +28 -0
- data/lib/moderation_api/models/components/rule_operator.rbi +9 -0
- data/lib/moderation_api/models/components/rule_value_1.rb +25 -0
- data/lib/moderation_api/models/components/rule_value_1.rbi +9 -0
- data/lib/moderation_api/models/components/rule_value_2.rb +25 -0
- data/lib/moderation_api/models/components/rule_value_2.rbi +9 -0
- data/lib/moderation_api/models/components/rulecondition.rb +69 -0
- data/lib/moderation_api/models/components/rulecondition.rbi +26 -0
- data/lib/moderation_api/models/components/rulecondition_operator.rb +24 -0
- data/lib/moderation_api/models/components/rulecondition_operator.rbi +9 -0
- data/lib/moderation_api/models/components/rulecondition_value_1.rb +25 -0
- data/lib/moderation_api/models/components/rulecondition_value_1.rbi +9 -0
- data/lib/moderation_api/models/components/rulecondition_value_2.rb +25 -0
- data/lib/moderation_api/models/components/rulecondition_value_2.rbi +9 -0
- data/lib/moderation_api/models/components/ruledefaultaction.rb +22 -0
- data/lib/moderation_api/models/components/ruledefaultaction.rbi +9 -0
- data/lib/moderation_api/models/components/ruleevaluationmode.rb +21 -0
- data/lib/moderation_api/models/components/ruleevaluationmode.rbi +9 -0
- data/lib/moderation_api/models/components/rulefield.rb +106 -0
- data/lib/moderation_api/models/components/rulefield.rbi +50 -0
- data/lib/moderation_api/models/components/rulefield_operator.rb +27 -0
- data/lib/moderation_api/models/components/rulefield_operator.rbi +9 -0
- data/lib/moderation_api/models/components/rulefield_type.rb +24 -0
- data/lib/moderation_api/models/components/rulefield_type.rbi +9 -0
- data/lib/moderation_api/models/components.rb +21 -0
- data/lib/moderation_api/models/errors/badrequesterror.rb +1 -0
- data/lib/moderation_api/models/errors/notfounderror.rb +3 -0
- data/lib/moderation_api/models/errors/permissiondeniederror.rb +1 -0
- data/lib/moderation_api/models/operations/actual.rb +50 -0
- data/lib/moderation_api/models/operations/actual.rbi +26 -0
- data/lib/moderation_api/models/operations/brand_status.rb +21 -0
- data/lib/moderation_api/models/operations/brand_status.rbi +9 -0
- data/lib/moderation_api/models/operations/campaign_request.rb +63 -0
- data/lib/moderation_api/models/operations/campaign_request.rbi +32 -0
- data/lib/moderation_api/models/operations/campaign_response.rb +84 -0
- data/lib/moderation_api/models/operations/campaign_response.rbi +38 -0
- data/lib/moderation_api/models/operations/campaign_status.rb +21 -0
- data/lib/moderation_api/models/operations/campaign_status.rbi +9 -0
- data/lib/moderation_api/models/operations/clientaction.rb +3 -3
- data/lib/moderation_api/models/operations/clientaction_action.rb +19 -0
- data/lib/moderation_api/models/operations/clientaction_action.rbi +9 -0
- data/lib/moderation_api/models/operations/cluster.rb +69 -0
- data/lib/moderation_api/models/operations/cluster.rbi +32 -0
- data/lib/moderation_api/models/operations/cluster_status.rb +23 -0
- data/lib/moderation_api/models/operations/cluster_status.rbi +9 -0
- data/lib/moderation_api/models/operations/createrule_action.rb +19 -0
- data/lib/moderation_api/models/operations/createrule_action.rbi +9 -0
- data/lib/moderation_api/models/operations/createrule_request.rb +45 -0
- data/lib/moderation_api/models/operations/createrule_request.rbi +26 -0
- data/lib/moderation_api/models/operations/createrule_requestbody.rb +100 -0
- data/lib/moderation_api/models/operations/createrule_requestbody.rbi +50 -0
- data/lib/moderation_api/models/operations/createrule_response.rb +51 -0
- data/lib/moderation_api/models/operations/createrule_response.rbi +32 -0
- data/lib/moderation_api/models/operations/createwebhook_eventtype_request.rb +9 -0
- data/lib/moderation_api/models/operations/createwebhook_eventtype_response.rb +9 -0
- data/lib/moderation_api/models/operations/deleterule_request.rb +39 -0
- data/lib/moderation_api/models/operations/deleterule_request.rbi +20 -0
- data/lib/moderation_api/models/operations/deleterule_response.rb +51 -0
- data/lib/moderation_api/models/operations/deleterule_response.rbi +32 -0
- data/lib/moderation_api/models/operations/deleterule_responsebody.rb +39 -0
- data/lib/moderation_api/models/operations/deleterule_responsebody.rbi +20 -0
- data/lib/moderation_api/models/operations/evaluationmode.rb +18 -0
- data/lib/moderation_api/models/operations/evaluationmode.rbi +9 -0
- data/lib/moderation_api/models/operations/getanalyticsautomation_responsebody.rb +2 -2
- data/lib/moderation_api/models/operations/{rule.rb → getanalyticsautomation_rule.rb} +1 -1
- data/lib/moderation_api/models/operations/{rule.rbi → getanalyticsautomation_rule.rbi} +2 -2
- data/lib/moderation_api/models/operations/getchannelguidelines_request.rb +31 -0
- data/lib/moderation_api/models/operations/getchannelguidelines_request.rbi +14 -0
- data/lib/moderation_api/models/operations/getchannelguidelines_response.rb +51 -0
- data/lib/moderation_api/models/operations/getchannelguidelines_response.rbi +32 -0
- data/lib/moderation_api/models/operations/getchannelguidelines_responsebody.rb +35 -0
- data/lib/moderation_api/models/operations/getchannelguidelines_responsebody.rbi +14 -0
- data/lib/moderation_api/models/operations/getchannelpolicies_request.rb +31 -0
- data/lib/moderation_api/models/operations/getchannelpolicies_request.rbi +14 -0
- data/lib/moderation_api/models/operations/getchannelpolicies_response.rb +51 -0
- data/lib/moderation_api/models/operations/getchannelpolicies_response.rbi +32 -0
- data/lib/moderation_api/models/operations/getchannelpolicies_responsebody.rb +35 -0
- data/lib/moderation_api/models/operations/getchannelpolicies_responsebody.rbi +14 -0
- data/lib/moderation_api/models/operations/getchannelwordlists_request.rb +31 -0
- data/lib/moderation_api/models/operations/getchannelwordlists_request.rbi +14 -0
- data/lib/moderation_api/models/operations/getchannelwordlists_response.rb +51 -0
- data/lib/moderation_api/models/operations/getchannelwordlists_response.rbi +32 -0
- data/lib/moderation_api/models/operations/getchannelwordlists_responsebody.rb +35 -0
- data/lib/moderation_api/models/operations/getchannelwordlists_responsebody.rbi +14 -0
- data/lib/moderation_api/models/operations/getrule_request.rb +39 -0
- data/lib/moderation_api/models/operations/getrule_request.rbi +20 -0
- data/lib/moderation_api/models/operations/getrule_response.rb +51 -0
- data/lib/moderation_api/models/operations/getrule_response.rbi +32 -0
- data/lib/moderation_api/models/operations/getrulefields_request.rb +39 -0
- data/lib/moderation_api/models/operations/getrulefields_request.rbi +20 -0
- data/lib/moderation_api/models/operations/getrulefields_response.rb +51 -0
- data/lib/moderation_api/models/operations/getrulefields_response.rbi +32 -0
- data/lib/moderation_api/models/operations/getrulefields_responsebody.rb +35 -0
- data/lib/moderation_api/models/operations/getrulefields_responsebody.rbi +14 -0
- data/lib/moderation_api/models/operations/getwebhook_eventtype.rb +9 -0
- data/lib/moderation_api/models/operations/listrules_request.rb +63 -0
- data/lib/moderation_api/models/operations/listrules_request.rbi +32 -0
- data/lib/moderation_api/models/operations/listrules_response.rb +63 -0
- data/lib/moderation_api/models/operations/listrules_response.rbi +32 -0
- data/lib/moderation_api/models/operations/listrules_responsebody.rb +43 -0
- data/lib/moderation_api/models/operations/listrules_responsebody.rbi +20 -0
- data/lib/moderation_api/models/operations/listwebhooks_eventtype.rb +9 -0
- data/lib/moderation_api/models/operations/policyid.rb +25 -0
- data/lib/moderation_api/models/operations/policyid.rbi +9 -0
- data/lib/moderation_api/models/operations/reason_code_enum.rb +3 -0
- data/lib/moderation_api/models/operations/{action_request.rb → ruledefaultaction.rb} +2 -2
- data/lib/moderation_api/models/operations/ruledefaultaction.rbi +9 -0
- data/lib/moderation_api/models/operations/ruleevaluationmode.rb +18 -0
- data/lib/moderation_api/models/operations/ruleevaluationmode.rbi +9 -0
- data/lib/moderation_api/models/operations/signal.rb +25 -0
- data/lib/moderation_api/models/operations/signal.rbi +9 -0
- data/lib/moderation_api/models/operations/simulated.rb +50 -0
- data/lib/moderation_api/models/operations/simulated.rbi +26 -0
- data/lib/moderation_api/models/operations/simulaterules_action.rb +19 -0
- data/lib/moderation_api/models/operations/simulaterules_action.rbi +9 -0
- data/lib/moderation_api/models/operations/simulaterules_request.rb +45 -0
- data/lib/moderation_api/models/operations/simulaterules_request.rbi +26 -0
- data/lib/moderation_api/models/operations/simulaterules_requestbody.rb +54 -0
- data/lib/moderation_api/models/operations/simulaterules_requestbody.rbi +20 -0
- data/lib/moderation_api/models/operations/simulaterules_response.rb +51 -0
- data/lib/moderation_api/models/operations/simulaterules_response.rbi +32 -0
- data/lib/moderation_api/models/operations/simulaterules_responsebody.rb +67 -0
- data/lib/moderation_api/models/operations/simulaterules_responsebody.rbi +32 -0
- data/lib/moderation_api/models/operations/simulaterules_rule.rb +82 -0
- data/lib/moderation_api/models/operations/simulaterules_rule.rbi +38 -0
- data/lib/moderation_api/models/operations/sort.rb +1 -0
- data/lib/moderation_api/models/operations/{guideline.rb → submitcontent_guideline.rb} +1 -1
- data/lib/moderation_api/models/operations/{guideline.rbi → submitcontent_guideline.rbi} +2 -2
- data/lib/moderation_api/models/operations/{policy_request.rb → submitcontent_policy_request.rb} +1 -1
- data/lib/moderation_api/models/operations/submitcontent_policy_request.rbi +9 -0
- data/lib/moderation_api/models/operations/submitcontent_requestbody.rb +13 -3
- data/lib/moderation_api/models/operations/submitcontent_requestbody.rbi +6 -0
- data/lib/moderation_api/models/operations/submitcontent_responsebody.rb +12 -2
- data/lib/moderation_api/models/operations/submitcontent_responsebody.rbi +6 -0
- data/lib/moderation_api/models/operations/timerange.rb +38 -0
- data/lib/moderation_api/models/operations/timerange.rbi +20 -0
- data/lib/moderation_api/models/operations/updatechannel_requestbody.rb +82 -2
- data/lib/moderation_api/models/operations/updatechannel_requestbody.rbi +42 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_guideline.rb +72 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_guideline.rbi +38 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_request.rb +39 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_request.rbi +20 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_requestbody.rb +35 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_requestbody.rbi +14 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_response.rb +51 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_response.rbi +32 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_responsebody.rb +35 -0
- data/lib/moderation_api/models/operations/updatechannelguidelines_responsebody.rbi +14 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_policy.rb +72 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_policy.rbi +38 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_request.rb +39 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_request.rbi +20 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_requestbody.rb +35 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_requestbody.rbi +14 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_response.rb +51 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_response.rbi +32 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_responsebody.rb +35 -0
- data/lib/moderation_api/models/operations/updatechannelpolicies_responsebody.rbi +14 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_request.rb +39 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_request.rbi +20 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_requestbody.rb +35 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_requestbody.rbi +14 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_response.rb +51 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_response.rbi +32 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_responsebody.rb +35 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_responsebody.rbi +14 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_type.rb +19 -0
- data/lib/moderation_api/models/operations/updatechannelwordlists_type.rbi +9 -0
- data/lib/moderation_api/models/operations/updaterule_action.rb +19 -0
- data/lib/moderation_api/models/operations/updaterule_action.rbi +9 -0
- data/lib/moderation_api/models/operations/updaterule_request.rb +45 -0
- data/lib/moderation_api/models/operations/updaterule_request.rbi +26 -0
- data/lib/moderation_api/models/operations/updaterule_requestbody.rb +90 -0
- data/lib/moderation_api/models/operations/updaterule_requestbody.rbi +44 -0
- data/lib/moderation_api/models/operations/updaterule_response.rb +51 -0
- data/lib/moderation_api/models/operations/updaterule_response.rbi +32 -0
- data/lib/moderation_api/models/operations/updatewebhook_eventtype_request.rb +9 -0
- data/lib/moderation_api/models/operations/updatewebhook_eventtype_response.rb +9 -0
- data/lib/moderation_api/models/operations/upgradechannelpolicy_request.rb +39 -0
- data/lib/moderation_api/models/operations/upgradechannelpolicy_request.rbi +20 -0
- data/lib/moderation_api/models/operations/upgradechannelpolicy_response.rb +51 -0
- data/lib/moderation_api/models/operations/upgradechannelpolicy_response.rbi +32 -0
- data/lib/moderation_api/models/operations/upgradechannelpolicy_responsebody.rb +43 -0
- data/lib/moderation_api/models/operations/upgradechannelpolicy_responsebody.rbi +20 -0
- data/lib/moderation_api/models/operations/wordlist.rb +81 -0
- data/lib/moderation_api/models/operations/wordlist.rbi +38 -0
- data/lib/moderation_api/models/operations.rb +98 -4
- data/lib/moderation_api/moderationapi.rb +3 -1
- data/lib/moderation_api/policies.rb +818 -0
- data/lib/moderation_api/rules.rb +1860 -0
- data/lib/moderation_api/sdkconfiguration.rb +2 -2
- data/lib/moderation_api/wordlists.rb +555 -0
- data/lib/moderation_api.rb +4 -0
- metadata +190 -10
- data/lib/moderation_api/models/operations/action_request.rbi +0 -9
- data/lib/moderation_api/models/operations/policy_request.rbi +0 -9
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
# RuleConditionOperator - How to compare. The field's `operators` in Get rule fields lists the ones it takes.
|
|
10
|
+
class RuleConditionOperator < T::Enum
|
|
11
|
+
enums do
|
|
12
|
+
EQ = new("eq")
|
|
13
|
+
NEQ = new("neq")
|
|
14
|
+
GT = new("gt")
|
|
15
|
+
GTE = new("gte")
|
|
16
|
+
LT = new("lt")
|
|
17
|
+
LTE = new("lte")
|
|
18
|
+
IN = new("in")
|
|
19
|
+
NOT_IN = new("not_in")
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
|
|
10
|
+
class RuleConditionValue1
|
|
11
|
+
extend T::Sig
|
|
12
|
+
include Crystalline::MetadataFields
|
|
13
|
+
|
|
14
|
+
def initialize
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
18
|
+
def ==(other)
|
|
19
|
+
return false unless other.is_a?(self.class)
|
|
20
|
+
true
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
# The value to compare with. Scores are 0 to 1, so 80% is `0.8`; fields with `format: integer` are plain counts. Use a list with `in` and `not_in`.
|
|
10
|
+
class RuleConditionValue2
|
|
11
|
+
extend T::Sig
|
|
12
|
+
include Crystalline::MetadataFields
|
|
13
|
+
|
|
14
|
+
def initialize
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
18
|
+
def ==(other)
|
|
19
|
+
return false unless other.is_a?(self.class)
|
|
20
|
+
true
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
# RuleDefaultAction - The action when no rule matches.
|
|
10
|
+
class RuleDefaultAction
|
|
11
|
+
include ::Crystalline::Enum
|
|
12
|
+
enums do
|
|
13
|
+
REVIEW = new("review")
|
|
14
|
+
ALLOW = new("allow")
|
|
15
|
+
REJECT = new("reject")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
open!
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
# RuleEvaluationMode - `FIRST_MATCH`: the first matching rule, by priority, decides the action. `MOST_RESTRICTIVE`: every matching rule counts, and the strictest action wins.
|
|
10
|
+
class RuleEvaluationMode
|
|
11
|
+
include ::Crystalline::Enum
|
|
12
|
+
enums do
|
|
13
|
+
MOST_RESTRICTIVE = new("MOST_RESTRICTIVE")
|
|
14
|
+
FIRST_MATCH = new("FIRST_MATCH")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
open!
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
|
|
10
|
+
class RuleField
|
|
11
|
+
extend T::Sig
|
|
12
|
+
include Crystalline::MetadataFields
|
|
13
|
+
|
|
14
|
+
# The value for `field` in a condition.
|
|
15
|
+
field(
|
|
16
|
+
:field,
|
|
17
|
+
::String,
|
|
18
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("field"), required: true}}
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
field(
|
|
22
|
+
:label,
|
|
23
|
+
::String,
|
|
24
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("label"), required: true}}
|
|
25
|
+
)
|
|
26
|
+
# What the field belongs to, for example a policy or "Author".
|
|
27
|
+
field(
|
|
28
|
+
:group,
|
|
29
|
+
::String,
|
|
30
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("group"), required: true}}
|
|
31
|
+
)
|
|
32
|
+
# The kind of value. Numbers are 0 to 1 scores unless `format` is `integer`.
|
|
33
|
+
field(
|
|
34
|
+
:type,
|
|
35
|
+
Models::Components::RuleFieldType,
|
|
36
|
+
{
|
|
37
|
+
'format_json': {
|
|
38
|
+
'letter_case': ::ModerationApi::Utils.field_name("type"),
|
|
39
|
+
required: true,
|
|
40
|
+
'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::RuleFieldType, false)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
# The operators this field takes.
|
|
45
|
+
field(
|
|
46
|
+
:operators,
|
|
47
|
+
Crystalline::Array.new(Models::Components::RuleFieldOperator),
|
|
48
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("operators"), required: true}}
|
|
49
|
+
)
|
|
50
|
+
# `integer` for plain counts, such as days or redirects.
|
|
51
|
+
field(
|
|
52
|
+
:format,
|
|
53
|
+
Crystalline::Nilable.new(Models::Components::Format),
|
|
54
|
+
{
|
|
55
|
+
'format_json': {
|
|
56
|
+
'letter_case': ::ModerationApi::Utils.field_name("format"),
|
|
57
|
+
required: true,
|
|
58
|
+
'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::Format, false)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
# For enums: the values the field can have.
|
|
63
|
+
field(
|
|
64
|
+
:values,
|
|
65
|
+
Crystalline::Nilable.new(Crystalline::Array.new(::String)),
|
|
66
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("values"), required: true}}
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
sig {
|
|
70
|
+
params(
|
|
71
|
+
field: ::String,
|
|
72
|
+
label: ::String,
|
|
73
|
+
group: ::String,
|
|
74
|
+
type: Models::Components::RuleFieldType,
|
|
75
|
+
operators: T::Array[Models::Components::RuleFieldOperator],
|
|
76
|
+
format: T.nilable(Models::Components::Format),
|
|
77
|
+
values: T.nilable(T::Array[::String])
|
|
78
|
+
)
|
|
79
|
+
.void
|
|
80
|
+
}
|
|
81
|
+
def initialize(field:, label:, group:, type:, operators:, format: nil, values: nil)
|
|
82
|
+
@field = field
|
|
83
|
+
@label = label
|
|
84
|
+
@group = group
|
|
85
|
+
@type = type
|
|
86
|
+
@operators = operators
|
|
87
|
+
@format = format
|
|
88
|
+
@values = values
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
92
|
+
def ==(other)
|
|
93
|
+
return false unless other.is_a?(self.class)
|
|
94
|
+
return false unless @field == other.field
|
|
95
|
+
return false unless @label == other.label
|
|
96
|
+
return false unless @group == other.group
|
|
97
|
+
return false unless @type == other.type
|
|
98
|
+
return false unless @operators == other.operators
|
|
99
|
+
return false unless @format == other.format
|
|
100
|
+
return false unless @values == other.values
|
|
101
|
+
true
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class ModerationApi::Models::Components::RuleField
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class ModerationApi::Models::Components::RuleField
|
|
9
|
+
def field
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def field=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def label
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def label=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def group
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def group=(str_)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def type
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def type=(str_)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def operators
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def operators=(str_)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def format
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def format=(str_)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def values
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def values=(str_)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
|
|
10
|
+
class RuleFieldOperator
|
|
11
|
+
include ::Crystalline::Enum
|
|
12
|
+
enums do
|
|
13
|
+
EQ = new("eq")
|
|
14
|
+
NEQ = new("neq")
|
|
15
|
+
GT = new("gt")
|
|
16
|
+
GTE = new("gte")
|
|
17
|
+
LT = new("lt")
|
|
18
|
+
LTE = new("lte")
|
|
19
|
+
IN = new("in")
|
|
20
|
+
NOT_IN = new("not_in")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
open!
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
# RuleFieldType - The kind of value. Numbers are 0 to 1 scores unless `format` is `integer`.
|
|
10
|
+
class RuleFieldType
|
|
11
|
+
include ::Crystalline::Enum
|
|
12
|
+
enums do
|
|
13
|
+
BOOLEAN = new("boolean")
|
|
14
|
+
NUMBER = new("number")
|
|
15
|
+
STRING = new("string")
|
|
16
|
+
ENUM = new("enum")
|
|
17
|
+
ORDINAL_ENUM = new("ordinal_enum")
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
open!
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -9,6 +9,11 @@ module ModerationApi
|
|
|
9
9
|
autoload :AuthenticationErrorCode, "moderation_api/models/components/authenticationerror_code.rb"
|
|
10
10
|
autoload :BadRequestErrorCode, "moderation_api/models/components/badrequesterror_code.rb"
|
|
11
11
|
autoload :Channel, "moderation_api/models/components/channel.rb"
|
|
12
|
+
autoload :ChannelGuideline, "moderation_api/models/components/channelguideline.rb"
|
|
13
|
+
autoload :ChannelPolicy, "moderation_api/models/components/channelpolicy.rb"
|
|
14
|
+
autoload :ChannelPolicyType, "moderation_api/models/components/channelpolicy_type.rb"
|
|
15
|
+
autoload :ChannelWordlist, "moderation_api/models/components/channelwordlist.rb"
|
|
16
|
+
autoload :ChannelWordlistType, "moderation_api/models/components/channelwordlist_type.rb"
|
|
12
17
|
autoload :ConflictErrorCode, "moderation_api/models/components/conflicterror_code.rb"
|
|
13
18
|
autoload :ErrorIssue, "moderation_api/models/components/errorissue.rb"
|
|
14
19
|
autoload :InternalServerErrorCode, "moderation_api/models/components/internalservererror_code.rb"
|
|
@@ -44,15 +49,31 @@ module ModerationApi
|
|
|
44
49
|
autoload :QueueItemStatus, "moderation_api/models/components/queueitem_status.rb"
|
|
45
50
|
autoload :QueueWithCounts, "moderation_api/models/components/queuewithcounts.rb"
|
|
46
51
|
autoload :RateLimitErrorCode, "moderation_api/models/components/ratelimiterror_code.rb"
|
|
52
|
+
autoload :Rule, "moderation_api/models/components/rule.rb"
|
|
53
|
+
autoload :RuleCondition, "moderation_api/models/components/rulecondition.rb"
|
|
54
|
+
autoload :RuleConditionOperator, "moderation_api/models/components/rulecondition_operator.rb"
|
|
55
|
+
autoload :RuleConditionValue1, "moderation_api/models/components/rulecondition_value_1.rb"
|
|
56
|
+
autoload :RuleConditionValue2, "moderation_api/models/components/rulecondition_value_2.rb"
|
|
57
|
+
autoload :RuleField, "moderation_api/models/components/rulefield.rb"
|
|
58
|
+
autoload :RuleFieldOperator, "moderation_api/models/components/rulefield_operator.rb"
|
|
59
|
+
autoload :RuleFieldType, "moderation_api/models/components/rulefield_type.rb"
|
|
60
|
+
autoload :RuleAction, "moderation_api/models/components/rule_action.rb"
|
|
61
|
+
autoload :RuleOperator, "moderation_api/models/components/rule_operator.rb"
|
|
62
|
+
autoload :RuleValue1, "moderation_api/models/components/rule_value_1.rb"
|
|
63
|
+
autoload :RuleValue2, "moderation_api/models/components/rule_value_2.rb"
|
|
47
64
|
autoload :Security, "moderation_api/models/components/security.rb"
|
|
48
65
|
autoload :Block, "moderation_api/models/components/block.rb"
|
|
66
|
+
autoload :Condition, "moderation_api/models/components/condition.rb"
|
|
49
67
|
autoload :ContentType, "moderation_api/models/components/contenttype.rb"
|
|
50
68
|
autoload :FlaggingMode, "moderation_api/models/components/flaggingmode.rb"
|
|
69
|
+
autoload :Format, "moderation_api/models/components/format.rb"
|
|
51
70
|
autoload :Label, "moderation_api/models/components/label.rb"
|
|
52
71
|
autoload :Metadata, "moderation_api/models/components/metadata.rb"
|
|
53
72
|
autoload :Metrics, "moderation_api/models/components/metrics.rb"
|
|
54
73
|
autoload :Path, "moderation_api/models/components/path.rb"
|
|
55
74
|
autoload :RiskEvaluation, "moderation_api/models/components/risk_evaluation.rb"
|
|
75
|
+
autoload :RuleDefaultAction, "moderation_api/models/components/ruledefaultaction.rb"
|
|
76
|
+
autoload :RuleEvaluationMode, "moderation_api/models/components/ruleevaluationmode.rb"
|
|
56
77
|
autoload :TranscriptionQuality, "moderation_api/models/components/transcriptionquality.rb"
|
|
57
78
|
autoload :TrustLevel, "moderation_api/models/components/trust_level.rb"
|
|
58
79
|
end
|
|
@@ -14,6 +14,7 @@ module ModerationApi
|
|
|
14
14
|
# Exactly what went wrong. Stable; safe to branch on. New codes may be added.
|
|
15
15
|
#
|
|
16
16
|
# - `invalid_request`: A parameter is invalid. `message` says which one.
|
|
17
|
+
# - `rule_key_taken`: The channel already has a rule with this key.
|
|
17
18
|
# - `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the key reaches more than one project. `message` lists the projects it reaches.
|
|
18
19
|
# - `project_name_ambiguous`: The name in `Project-Id` fits more than one project the key reaches. `message` lists them; name the project by ID instead.
|
|
19
20
|
# - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`.
|
|
@@ -20,8 +20,11 @@ module ModerationApi
|
|
|
20
20
|
# - `queue_item_not_found`: The queue item does not exist in the project.
|
|
21
21
|
# - `wordlist_not_found`: The wordlist does not exist.
|
|
22
22
|
# - `webhook_not_found`: The webhook does not exist.
|
|
23
|
+
# - `rule_not_found`: The rule does not exist.
|
|
23
24
|
# - `project_not_found`: The project does not exist.
|
|
24
25
|
# - `channel_not_found`: The channel does not exist.
|
|
26
|
+
# - `campaign_not_found`: The campaign does not exist.
|
|
27
|
+
# - `brand_not_found`: The brand does not exist.
|
|
25
28
|
field(
|
|
26
29
|
:code,
|
|
27
30
|
Models::Components::NotFoundErrorCode,
|
|
@@ -17,6 +17,7 @@ module ModerationApi
|
|
|
17
17
|
# - `account_disabled`: The organization account is disabled.
|
|
18
18
|
# - `quota_exceeded`: The organization has used all API requests on its plan.
|
|
19
19
|
# - `plan_feature_unavailable`: The current plan does not include this feature.
|
|
20
|
+
# - `campaigns_not_enabled`: The campaign add-on is switched off for the project.
|
|
20
21
|
# - `plan_limit_exceeded`: The request goes over a limit of the current plan.
|
|
21
22
|
# - `organization_key_required`: This endpoint needs an organization API key, but a project key was used.
|
|
22
23
|
# - `missing_key_permission`: The organization key does not have the permission this endpoint needs.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Operations
|
|
9
|
+
# What the sample got from the rules the channel ran at the time.
|
|
10
|
+
class Actual
|
|
11
|
+
extend T::Sig
|
|
12
|
+
include Crystalline::MetadataFields
|
|
13
|
+
|
|
14
|
+
field(
|
|
15
|
+
:allow,
|
|
16
|
+
::Integer,
|
|
17
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("allow"), required: true}}
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
field(
|
|
21
|
+
:review,
|
|
22
|
+
::Integer,
|
|
23
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("review"), required: true}}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
field(
|
|
27
|
+
:reject,
|
|
28
|
+
::Integer,
|
|
29
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reject"), required: true}}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
sig { params(allow: ::Integer, review: ::Integer, reject: ::Integer).void }
|
|
33
|
+
def initialize(allow:, review:, reject:)
|
|
34
|
+
@allow = allow
|
|
35
|
+
@review = review
|
|
36
|
+
@reject = reject
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
40
|
+
def ==(other)
|
|
41
|
+
return false unless other.is_a?(self.class)
|
|
42
|
+
return false unless @allow == other.allow
|
|
43
|
+
return false unless @review == other.review
|
|
44
|
+
return false unless @reject == other.reject
|
|
45
|
+
true
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class ModerationApi::Models::Operations::Actual
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class ModerationApi::Models::Operations::Actual
|
|
9
|
+
def allow
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def allow=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def review
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def review=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def reject
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def reject=(str_)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Operations
|
|
9
|
+
|
|
10
|
+
class BrandStatus
|
|
11
|
+
include ::Crystalline::Enum
|
|
12
|
+
enums do
|
|
13
|
+
ENABLED = new("enabled")
|
|
14
|
+
BLOCKED = new("blocked")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
open!
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module ModerationApi
|
|
7
|
+
module Models
|
|
8
|
+
module Operations
|
|
9
|
+
# The messaging campaign (10DLC) that sends this message. Requires the campaign add-on.
|
|
10
|
+
class CampaignRequest
|
|
11
|
+
extend T::Sig
|
|
12
|
+
include Crystalline::MetadataFields
|
|
13
|
+
|
|
14
|
+
# Your ID for the campaign, for example the TCR campaign ID. The campaign is created the first time we see it.
|
|
15
|
+
field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}}
|
|
16
|
+
# Your ID for the brand that owns the campaign, for example the TCR brand ID.
|
|
17
|
+
field(
|
|
18
|
+
:brand_id,
|
|
19
|
+
Crystalline::Nilable.new(::String),
|
|
20
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("brandId")}}
|
|
21
|
+
)
|
|
22
|
+
# The ID of the account in your system that sends for this campaign.
|
|
23
|
+
field(
|
|
24
|
+
:account_id,
|
|
25
|
+
Crystalline::Nilable.new(::String),
|
|
26
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("accountId")}}
|
|
27
|
+
)
|
|
28
|
+
# The ID of the sub-account in your system that sends for this campaign.
|
|
29
|
+
field(
|
|
30
|
+
:sub_account_id,
|
|
31
|
+
Crystalline::Nilable.new(::String),
|
|
32
|
+
{'format_json': {'letter_case': ::ModerationApi::Utils.field_name("subAccountId")}}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
sig {
|
|
36
|
+
params(
|
|
37
|
+
id: ::String,
|
|
38
|
+
brand_id: T.nilable(::String),
|
|
39
|
+
account_id: T.nilable(::String),
|
|
40
|
+
sub_account_id: T.nilable(::String)
|
|
41
|
+
)
|
|
42
|
+
.void
|
|
43
|
+
}
|
|
44
|
+
def initialize(id:, brand_id: nil, account_id: nil, sub_account_id: nil)
|
|
45
|
+
@id = id
|
|
46
|
+
@brand_id = brand_id
|
|
47
|
+
@account_id = account_id
|
|
48
|
+
@sub_account_id = sub_account_id
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
52
|
+
def ==(other)
|
|
53
|
+
return false unless other.is_a?(self.class)
|
|
54
|
+
return false unless @id == other.id
|
|
55
|
+
return false unless @brand_id == other.brand_id
|
|
56
|
+
return false unless @account_id == other.account_id
|
|
57
|
+
return false unless @sub_account_id == other.sub_account_id
|
|
58
|
+
true
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|