dodopayments 2.28.0 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +1 -1
- data/lib/dodopayments/client.rb +4 -0
- data/lib/dodopayments/models/balance_ledger_entry.rb +7 -0
- data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +7 -0
- data/lib/dodopayments/models/checkout_session_flags.rb +30 -1
- data/lib/dodopayments/models/checkout_session_preview_response.rb +86 -4
- data/lib/dodopayments/models/checkout_session_request.rb +4 -1
- data/lib/dodopayments/models/customers/email_failure_code.rb +1 -0
- data/lib/dodopayments/models/customers/email_log_item.rb +4 -12
- data/lib/dodopayments/models/customers/email_policies.rb +14 -1
- data/lib/dodopayments/models/discount_create_params.rb +11 -8
- data/lib/dodopayments/models/discount_update_params.rb +6 -5
- data/lib/dodopayments/models/moderation_category.rb +31 -0
- data/lib/dodopayments/models/moderation_category_provenance.rb +150 -0
- data/lib/dodopayments/models/moderation_category_scores.rb +150 -0
- data/lib/dodopayments/models/moderation_decision.rb +18 -0
- data/lib/dodopayments/models/moderation_provenance.rb +18 -0
- data/lib/dodopayments/models/moderation_retrieve_usage_params.rb +14 -0
- data/lib/dodopayments/models/moderation_retrieve_usage_response.rb +61 -0
- data/lib/dodopayments/models/moderation_screen_params.rb +44 -0
- data/lib/dodopayments/models/moderation_screen_response.rb +99 -0
- data/lib/dodopayments/models/payment.rb +25 -3
- data/lib/dodopayments/models/payment_list_response.rb +21 -1
- data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +5 -4
- data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +17 -1
- data/lib/dodopayments/models.rb +14 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +2 -2
- data/lib/dodopayments/resources/moderation.rb +81 -0
- data/lib/dodopayments/resources/payouts/breakup/details.rb +4 -4
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +10 -0
- data/rbi/dodopayments/client.rbi +3 -0
- data/rbi/dodopayments/models/balance_ledger_entry.rbi +35 -0
- data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +35 -0
- data/rbi/dodopayments/models/checkout_session_flags.rbi +48 -0
- data/rbi/dodopayments/models/checkout_session_preview_response.rbi +130 -6
- data/rbi/dodopayments/models/checkout_session_request.rbi +6 -0
- data/rbi/dodopayments/models/customers/email_failure_code.rbi +5 -0
- data/rbi/dodopayments/models/customers/email_log_item.rbi +4 -12
- data/rbi/dodopayments/models/customers/email_policies.rbi +15 -3
- data/rbi/dodopayments/models/discount_create_params.rbi +18 -12
- data/rbi/dodopayments/models/discount_update_params.rbi +8 -6
- data/rbi/dodopayments/models/moderation_category.rbi +88 -0
- data/rbi/dodopayments/models/moderation_category_provenance.rbi +184 -0
- data/rbi/dodopayments/models/moderation_category_scores.rbi +171 -0
- data/rbi/dodopayments/models/moderation_decision.rbi +27 -0
- data/rbi/dodopayments/models/moderation_provenance.rbi +28 -0
- data/rbi/dodopayments/models/moderation_retrieve_usage_params.rbi +32 -0
- data/rbi/dodopayments/models/moderation_retrieve_usage_response.rbi +104 -0
- data/rbi/dodopayments/models/moderation_screen_params.rbi +68 -0
- data/rbi/dodopayments/models/moderation_screen_response.rbi +135 -0
- data/rbi/dodopayments/models/payment.rbi +30 -2
- data/rbi/dodopayments/models/payment_list_response.rbi +24 -0
- data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +8 -6
- data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +19 -2
- data/rbi/dodopayments/models.rbi +16 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +6 -0
- data/rbi/dodopayments/resources/discounts.rbi +5 -3
- data/rbi/dodopayments/resources/moderation.rbi +64 -0
- data/rbi/dodopayments/resources/payouts/breakup/details.rbi +4 -4
- data/sig/dodopayments/client.rbs +2 -0
- data/sig/dodopayments/models/balance_ledger_entry.rbs +14 -0
- data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +14 -0
- data/sig/dodopayments/models/checkout_session_flags.rbs +14 -0
- data/sig/dodopayments/models/checkout_session_preview_response.rbs +52 -0
- data/sig/dodopayments/models/customers/email_failure_code.rbs +2 -0
- data/sig/dodopayments/models/customers/email_log_item.rbs +0 -5
- data/sig/dodopayments/models/customers/email_policies.rbs +8 -3
- data/sig/dodopayments/models/moderation_category.rbs +46 -0
- data/sig/dodopayments/models/moderation_category_provenance.rbs +100 -0
- data/sig/dodopayments/models/moderation_category_scores.rbs +100 -0
- data/sig/dodopayments/models/moderation_decision.rbs +15 -0
- data/sig/dodopayments/models/moderation_provenance.rbs +14 -0
- data/sig/dodopayments/models/moderation_retrieve_usage_params.rbs +15 -0
- data/sig/dodopayments/models/moderation_retrieve_usage_response.rbs +42 -0
- data/sig/dodopayments/models/moderation_screen_params.rbs +32 -0
- data/sig/dodopayments/models/moderation_screen_response.rbs +65 -0
- data/sig/dodopayments/models/payment.rbs +10 -0
- data/sig/dodopayments/models/payment_list_response.rbs +10 -0
- data/sig/dodopayments/models.rbs +14 -0
- data/sig/dodopayments/resources/moderation.rbs +18 -0
- metadata +32 -2
|
@@ -33,9 +33,11 @@ module Dodopayments
|
|
|
33
33
|
attr_accessor :code
|
|
34
34
|
|
|
35
35
|
# Per-currency options (flat deduction / percentage cap + minimum subtotal).
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
# `
|
|
36
|
+
# Checkout uses the row for the currency the buyer pays in. For any other currency
|
|
37
|
+
# it converts the default row. Required for `flat` codes (must include a
|
|
38
|
+
# resolvable default); optional per-currency caps for `percentage` codes. Per-row
|
|
39
|
+
# invariants are checked in `normalize_currency_options`, not via
|
|
40
|
+
# `#[validate(nested)]`.
|
|
39
41
|
sig do
|
|
40
42
|
returns(
|
|
41
43
|
T.nilable(
|
|
@@ -152,9 +154,11 @@ module Dodopayments
|
|
|
152
154
|
# - If omitted, a random 16-character code is generated.
|
|
153
155
|
code: nil,
|
|
154
156
|
# Per-currency options (flat deduction / percentage cap + minimum subtotal).
|
|
155
|
-
#
|
|
156
|
-
#
|
|
157
|
-
# `
|
|
157
|
+
# Checkout uses the row for the currency the buyer pays in. For any other currency
|
|
158
|
+
# it converts the default row. Required for `flat` codes (must include a
|
|
159
|
+
# resolvable default); optional per-currency caps for `percentage` codes. Per-row
|
|
160
|
+
# invariants are checked in `normalize_currency_options`, not via
|
|
161
|
+
# `#[validate(nested)]`.
|
|
158
162
|
currency_options: nil,
|
|
159
163
|
# Who may redeem this discount code. Defaults to `any` (unrestricted). `specific`
|
|
160
164
|
# starts with zero attached customers (fails closed) until customers are attached
|
|
@@ -225,12 +229,13 @@ module Dodopayments
|
|
|
225
229
|
)
|
|
226
230
|
end
|
|
227
231
|
|
|
228
|
-
# The currency this option applies to.
|
|
232
|
+
# The currency this option applies to. The row applies when the buyer pays in this
|
|
233
|
+
# currency.
|
|
229
234
|
sig { returns(Dodopayments::Currency::OrSymbol) }
|
|
230
235
|
attr_accessor :currency
|
|
231
236
|
|
|
232
|
-
# Whether this row is the default to convert from
|
|
233
|
-
# most one row per discount may be default.
|
|
237
|
+
# Whether this row is the default to convert from when the buyer pays in a
|
|
238
|
+
# currency that has no row. At most one row per discount may be default.
|
|
234
239
|
sig { returns(T.nilable(T::Boolean)) }
|
|
235
240
|
attr_reader :is_default
|
|
236
241
|
|
|
@@ -264,10 +269,11 @@ module Dodopayments
|
|
|
264
269
|
).returns(T.attached_class)
|
|
265
270
|
end
|
|
266
271
|
def self.new(
|
|
267
|
-
# The currency this option applies to.
|
|
272
|
+
# The currency this option applies to. The row applies when the buyer pays in this
|
|
273
|
+
# currency.
|
|
268
274
|
currency:,
|
|
269
|
-
# Whether this row is the default to convert from
|
|
270
|
-
# most one row per discount may be default.
|
|
275
|
+
# Whether this row is the default to convert from when the buyer pays in a
|
|
276
|
+
# currency that has no row. At most one row per discount may be default.
|
|
271
277
|
is_default: nil,
|
|
272
278
|
# The most this code discounts in this currency's subunits. For `flat` codes this
|
|
273
279
|
# is the deduction; for `percentage` codes it is the max-discount cap. Must be > 0
|
|
@@ -211,12 +211,13 @@ module Dodopayments
|
|
|
211
211
|
)
|
|
212
212
|
end
|
|
213
213
|
|
|
214
|
-
# The currency this option applies to.
|
|
214
|
+
# The currency this option applies to. The row applies when the buyer pays in this
|
|
215
|
+
# currency.
|
|
215
216
|
sig { returns(Dodopayments::Currency::OrSymbol) }
|
|
216
217
|
attr_accessor :currency
|
|
217
218
|
|
|
218
|
-
# Whether this row is the default to convert from
|
|
219
|
-
# most one row per discount may be default.
|
|
219
|
+
# Whether this row is the default to convert from when the buyer pays in a
|
|
220
|
+
# currency that has no row. At most one row per discount may be default.
|
|
220
221
|
sig { returns(T.nilable(T::Boolean)) }
|
|
221
222
|
attr_reader :is_default
|
|
222
223
|
|
|
@@ -250,10 +251,11 @@ module Dodopayments
|
|
|
250
251
|
).returns(T.attached_class)
|
|
251
252
|
end
|
|
252
253
|
def self.new(
|
|
253
|
-
# The currency this option applies to.
|
|
254
|
+
# The currency this option applies to. The row applies when the buyer pays in this
|
|
255
|
+
# currency.
|
|
254
256
|
currency:,
|
|
255
|
-
# Whether this row is the default to convert from
|
|
256
|
-
# most one row per discount may be default.
|
|
257
|
+
# Whether this row is the default to convert from when the buyer pays in a
|
|
258
|
+
# currency that has no row. At most one row per discount may be default.
|
|
257
259
|
is_default: nil,
|
|
258
260
|
# The most this code discounts in this currency's subunits. For `flat` codes this
|
|
259
261
|
# is the deduction; for `percentage` codes it is the max-discount cap. Must be > 0
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# A moderation category.
|
|
6
|
+
module ModerationCategory
|
|
7
|
+
extend Dodopayments::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol =
|
|
10
|
+
T.type_alias { T.all(Symbol, Dodopayments::ModerationCategory) }
|
|
11
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
12
|
+
|
|
13
|
+
VIOLENT_CRIMES =
|
|
14
|
+
T.let(:violent_crimes, Dodopayments::ModerationCategory::TaggedSymbol)
|
|
15
|
+
SEX_RELATED_CRIMES =
|
|
16
|
+
T.let(
|
|
17
|
+
:sex_related_crimes,
|
|
18
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
19
|
+
)
|
|
20
|
+
CHILD_SEXUAL_EXPLOITATION =
|
|
21
|
+
T.let(
|
|
22
|
+
:child_sexual_exploitation,
|
|
23
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
24
|
+
)
|
|
25
|
+
SUICIDE_AND_SELF_HARM =
|
|
26
|
+
T.let(
|
|
27
|
+
:suicide_and_self_harm,
|
|
28
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
29
|
+
)
|
|
30
|
+
INDISCRIMINATE_WEAPONS =
|
|
31
|
+
T.let(
|
|
32
|
+
:indiscriminate_weapons,
|
|
33
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
34
|
+
)
|
|
35
|
+
INTELLECTUAL_PROPERTY =
|
|
36
|
+
T.let(
|
|
37
|
+
:intellectual_property,
|
|
38
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
39
|
+
)
|
|
40
|
+
DEFAMATION =
|
|
41
|
+
T.let(:defamation, Dodopayments::ModerationCategory::TaggedSymbol)
|
|
42
|
+
NON_VIOLENT_CRIMES =
|
|
43
|
+
T.let(
|
|
44
|
+
:non_violent_crimes,
|
|
45
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
46
|
+
)
|
|
47
|
+
HATE = T.let(:hate, Dodopayments::ModerationCategory::TaggedSymbol)
|
|
48
|
+
PRIVACY = T.let(:privacy, Dodopayments::ModerationCategory::TaggedSymbol)
|
|
49
|
+
SPECIALIZED_ADVICE =
|
|
50
|
+
T.let(
|
|
51
|
+
:specialized_advice,
|
|
52
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
53
|
+
)
|
|
54
|
+
SEXUAL_CONTENT =
|
|
55
|
+
T.let(:sexual_content, Dodopayments::ModerationCategory::TaggedSymbol)
|
|
56
|
+
NON_CONSENSUAL_INTIMATE_IMAGERY =
|
|
57
|
+
T.let(
|
|
58
|
+
:non_consensual_intimate_imagery,
|
|
59
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
60
|
+
)
|
|
61
|
+
MINOR_CODED_LANGUAGE =
|
|
62
|
+
T.let(
|
|
63
|
+
:minor_coded_language,
|
|
64
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
65
|
+
)
|
|
66
|
+
REAL_PERSON_LIKENESS =
|
|
67
|
+
T.let(
|
|
68
|
+
:real_person_likeness,
|
|
69
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
70
|
+
)
|
|
71
|
+
LIVING_ARTIST_STYLE =
|
|
72
|
+
T.let(
|
|
73
|
+
:living_artist_style,
|
|
74
|
+
Dodopayments::ModerationCategory::TaggedSymbol
|
|
75
|
+
)
|
|
76
|
+
PROMPT_INJECTION =
|
|
77
|
+
T.let(:prompt_injection, Dodopayments::ModerationCategory::TaggedSymbol)
|
|
78
|
+
|
|
79
|
+
sig do
|
|
80
|
+
override.returns(
|
|
81
|
+
T::Array[Dodopayments::ModerationCategory::TaggedSymbol]
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
def self.values
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ModerationCategoryProvenance < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::ModerationCategoryProvenance,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Child sexual exploitation.
|
|
15
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
16
|
+
attr_accessor :child_sexual_exploitation
|
|
17
|
+
|
|
18
|
+
# False depiction that is likely to injure the reputation of a real person.
|
|
19
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
20
|
+
attr_accessor :defamation
|
|
21
|
+
|
|
22
|
+
# Demeaning people because of a protected characteristic.
|
|
23
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
24
|
+
attr_accessor :hate
|
|
25
|
+
|
|
26
|
+
# Chemical, biological, radiological, nuclear or explosive weapons.
|
|
27
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
28
|
+
attr_accessor :indiscriminate_weapons
|
|
29
|
+
|
|
30
|
+
# Copyright or trademark infringement.
|
|
31
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
32
|
+
attr_accessor :intellectual_property
|
|
33
|
+
|
|
34
|
+
# Imitation of the signature style of a specific living artist.
|
|
35
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
36
|
+
attr_accessor :living_artist_style
|
|
37
|
+
|
|
38
|
+
# Age-coded language that suggests the subject is a minor.
|
|
39
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
40
|
+
attr_accessor :minor_coded_language
|
|
41
|
+
|
|
42
|
+
# Non-consensual intimate imagery: undressing, nudifying or sexualising a real
|
|
43
|
+
# person.
|
|
44
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
45
|
+
attr_accessor :non_consensual_intimate_imagery
|
|
46
|
+
|
|
47
|
+
# Non-violent crimes.
|
|
48
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
49
|
+
attr_accessor :non_violent_crimes
|
|
50
|
+
|
|
51
|
+
# Sensitive private information about a person.
|
|
52
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
53
|
+
attr_accessor :privacy
|
|
54
|
+
|
|
55
|
+
# An attempt to override or manipulate the instructions of the system.
|
|
56
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
57
|
+
attr_accessor :prompt_injection
|
|
58
|
+
|
|
59
|
+
# The likeness of a real, identifiable, named person.
|
|
60
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
61
|
+
attr_accessor :real_person_likeness
|
|
62
|
+
|
|
63
|
+
# Sex-related crimes.
|
|
64
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
65
|
+
attr_accessor :sex_related_crimes
|
|
66
|
+
|
|
67
|
+
# Sexually explicit or pornographic content.
|
|
68
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
69
|
+
attr_accessor :sexual_content
|
|
70
|
+
|
|
71
|
+
# Unqualified financial, medical, legal or electoral advice.
|
|
72
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
73
|
+
attr_accessor :specialized_advice
|
|
74
|
+
|
|
75
|
+
# Suicide and self-harm.
|
|
76
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
77
|
+
attr_accessor :suicide_and_self_harm
|
|
78
|
+
|
|
79
|
+
# Violent crimes.
|
|
80
|
+
sig { returns(Dodopayments::ModerationProvenance::TaggedSymbol) }
|
|
81
|
+
attr_accessor :violent_crimes
|
|
82
|
+
|
|
83
|
+
# How each score in `categories` was measured.
|
|
84
|
+
sig do
|
|
85
|
+
params(
|
|
86
|
+
child_sexual_exploitation:
|
|
87
|
+
Dodopayments::ModerationProvenance::OrSymbol,
|
|
88
|
+
defamation: Dodopayments::ModerationProvenance::OrSymbol,
|
|
89
|
+
hate: Dodopayments::ModerationProvenance::OrSymbol,
|
|
90
|
+
indiscriminate_weapons: Dodopayments::ModerationProvenance::OrSymbol,
|
|
91
|
+
intellectual_property: Dodopayments::ModerationProvenance::OrSymbol,
|
|
92
|
+
living_artist_style: Dodopayments::ModerationProvenance::OrSymbol,
|
|
93
|
+
minor_coded_language: Dodopayments::ModerationProvenance::OrSymbol,
|
|
94
|
+
non_consensual_intimate_imagery:
|
|
95
|
+
Dodopayments::ModerationProvenance::OrSymbol,
|
|
96
|
+
non_violent_crimes: Dodopayments::ModerationProvenance::OrSymbol,
|
|
97
|
+
privacy: Dodopayments::ModerationProvenance::OrSymbol,
|
|
98
|
+
prompt_injection: Dodopayments::ModerationProvenance::OrSymbol,
|
|
99
|
+
real_person_likeness: Dodopayments::ModerationProvenance::OrSymbol,
|
|
100
|
+
sex_related_crimes: Dodopayments::ModerationProvenance::OrSymbol,
|
|
101
|
+
sexual_content: Dodopayments::ModerationProvenance::OrSymbol,
|
|
102
|
+
specialized_advice: Dodopayments::ModerationProvenance::OrSymbol,
|
|
103
|
+
suicide_and_self_harm: Dodopayments::ModerationProvenance::OrSymbol,
|
|
104
|
+
violent_crimes: Dodopayments::ModerationProvenance::OrSymbol
|
|
105
|
+
).returns(T.attached_class)
|
|
106
|
+
end
|
|
107
|
+
def self.new(
|
|
108
|
+
# Child sexual exploitation.
|
|
109
|
+
child_sexual_exploitation:,
|
|
110
|
+
# False depiction that is likely to injure the reputation of a real person.
|
|
111
|
+
defamation:,
|
|
112
|
+
# Demeaning people because of a protected characteristic.
|
|
113
|
+
hate:,
|
|
114
|
+
# Chemical, biological, radiological, nuclear or explosive weapons.
|
|
115
|
+
indiscriminate_weapons:,
|
|
116
|
+
# Copyright or trademark infringement.
|
|
117
|
+
intellectual_property:,
|
|
118
|
+
# Imitation of the signature style of a specific living artist.
|
|
119
|
+
living_artist_style:,
|
|
120
|
+
# Age-coded language that suggests the subject is a minor.
|
|
121
|
+
minor_coded_language:,
|
|
122
|
+
# Non-consensual intimate imagery: undressing, nudifying or sexualising a real
|
|
123
|
+
# person.
|
|
124
|
+
non_consensual_intimate_imagery:,
|
|
125
|
+
# Non-violent crimes.
|
|
126
|
+
non_violent_crimes:,
|
|
127
|
+
# Sensitive private information about a person.
|
|
128
|
+
privacy:,
|
|
129
|
+
# An attempt to override or manipulate the instructions of the system.
|
|
130
|
+
prompt_injection:,
|
|
131
|
+
# The likeness of a real, identifiable, named person.
|
|
132
|
+
real_person_likeness:,
|
|
133
|
+
# Sex-related crimes.
|
|
134
|
+
sex_related_crimes:,
|
|
135
|
+
# Sexually explicit or pornographic content.
|
|
136
|
+
sexual_content:,
|
|
137
|
+
# Unqualified financial, medical, legal or electoral advice.
|
|
138
|
+
specialized_advice:,
|
|
139
|
+
# Suicide and self-harm.
|
|
140
|
+
suicide_and_self_harm:,
|
|
141
|
+
# Violent crimes.
|
|
142
|
+
violent_crimes:
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
sig do
|
|
147
|
+
override.returns(
|
|
148
|
+
{
|
|
149
|
+
child_sexual_exploitation:
|
|
150
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
151
|
+
defamation: Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
152
|
+
hate: Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
153
|
+
indiscriminate_weapons:
|
|
154
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
155
|
+
intellectual_property:
|
|
156
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
157
|
+
living_artist_style:
|
|
158
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
159
|
+
minor_coded_language:
|
|
160
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
161
|
+
non_consensual_intimate_imagery:
|
|
162
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
163
|
+
non_violent_crimes:
|
|
164
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
165
|
+
privacy: Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
166
|
+
prompt_injection: Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
167
|
+
real_person_likeness:
|
|
168
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
169
|
+
sex_related_crimes:
|
|
170
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
171
|
+
sexual_content: Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
172
|
+
specialized_advice:
|
|
173
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
174
|
+
suicide_and_self_harm:
|
|
175
|
+
Dodopayments::ModerationProvenance::TaggedSymbol,
|
|
176
|
+
violent_crimes: Dodopayments::ModerationProvenance::TaggedSymbol
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
def to_hash
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
end
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ModerationCategoryScores < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::ModerationCategoryScores,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Child sexual exploitation.
|
|
15
|
+
sig { returns(Float) }
|
|
16
|
+
attr_accessor :child_sexual_exploitation
|
|
17
|
+
|
|
18
|
+
# False depiction that is likely to injure the reputation of a real person.
|
|
19
|
+
sig { returns(Float) }
|
|
20
|
+
attr_accessor :defamation
|
|
21
|
+
|
|
22
|
+
# Demeaning people because of a protected characteristic.
|
|
23
|
+
sig { returns(Float) }
|
|
24
|
+
attr_accessor :hate
|
|
25
|
+
|
|
26
|
+
# Chemical, biological, radiological, nuclear or explosive weapons.
|
|
27
|
+
sig { returns(Float) }
|
|
28
|
+
attr_accessor :indiscriminate_weapons
|
|
29
|
+
|
|
30
|
+
# Copyright or trademark infringement.
|
|
31
|
+
sig { returns(Float) }
|
|
32
|
+
attr_accessor :intellectual_property
|
|
33
|
+
|
|
34
|
+
# Imitation of the signature style of a specific living artist.
|
|
35
|
+
sig { returns(Float) }
|
|
36
|
+
attr_accessor :living_artist_style
|
|
37
|
+
|
|
38
|
+
# Age-coded language that suggests the subject is a minor.
|
|
39
|
+
sig { returns(Float) }
|
|
40
|
+
attr_accessor :minor_coded_language
|
|
41
|
+
|
|
42
|
+
# Non-consensual intimate imagery: undressing, nudifying or sexualising a real
|
|
43
|
+
# person.
|
|
44
|
+
sig { returns(Float) }
|
|
45
|
+
attr_accessor :non_consensual_intimate_imagery
|
|
46
|
+
|
|
47
|
+
# Non-violent crimes.
|
|
48
|
+
sig { returns(Float) }
|
|
49
|
+
attr_accessor :non_violent_crimes
|
|
50
|
+
|
|
51
|
+
# Sensitive private information about a person.
|
|
52
|
+
sig { returns(Float) }
|
|
53
|
+
attr_accessor :privacy
|
|
54
|
+
|
|
55
|
+
# An attempt to override or manipulate the instructions of the system.
|
|
56
|
+
sig { returns(Float) }
|
|
57
|
+
attr_accessor :prompt_injection
|
|
58
|
+
|
|
59
|
+
# The likeness of a real, identifiable, named person.
|
|
60
|
+
sig { returns(Float) }
|
|
61
|
+
attr_accessor :real_person_likeness
|
|
62
|
+
|
|
63
|
+
# Sex-related crimes.
|
|
64
|
+
sig { returns(Float) }
|
|
65
|
+
attr_accessor :sex_related_crimes
|
|
66
|
+
|
|
67
|
+
# Sexually explicit or pornographic content.
|
|
68
|
+
sig { returns(Float) }
|
|
69
|
+
attr_accessor :sexual_content
|
|
70
|
+
|
|
71
|
+
# Unqualified financial, medical, legal or electoral advice.
|
|
72
|
+
sig { returns(Float) }
|
|
73
|
+
attr_accessor :specialized_advice
|
|
74
|
+
|
|
75
|
+
# Suicide and self-harm.
|
|
76
|
+
sig { returns(Float) }
|
|
77
|
+
attr_accessor :suicide_and_self_harm
|
|
78
|
+
|
|
79
|
+
# Violent crimes.
|
|
80
|
+
sig { returns(Float) }
|
|
81
|
+
attr_accessor :violent_crimes
|
|
82
|
+
|
|
83
|
+
# The probability, from 0 to 1, that the screen falls in each category.
|
|
84
|
+
sig do
|
|
85
|
+
params(
|
|
86
|
+
child_sexual_exploitation: Float,
|
|
87
|
+
defamation: Float,
|
|
88
|
+
hate: Float,
|
|
89
|
+
indiscriminate_weapons: Float,
|
|
90
|
+
intellectual_property: Float,
|
|
91
|
+
living_artist_style: Float,
|
|
92
|
+
minor_coded_language: Float,
|
|
93
|
+
non_consensual_intimate_imagery: Float,
|
|
94
|
+
non_violent_crimes: Float,
|
|
95
|
+
privacy: Float,
|
|
96
|
+
prompt_injection: Float,
|
|
97
|
+
real_person_likeness: Float,
|
|
98
|
+
sex_related_crimes: Float,
|
|
99
|
+
sexual_content: Float,
|
|
100
|
+
specialized_advice: Float,
|
|
101
|
+
suicide_and_self_harm: Float,
|
|
102
|
+
violent_crimes: Float
|
|
103
|
+
).returns(T.attached_class)
|
|
104
|
+
end
|
|
105
|
+
def self.new(
|
|
106
|
+
# Child sexual exploitation.
|
|
107
|
+
child_sexual_exploitation:,
|
|
108
|
+
# False depiction that is likely to injure the reputation of a real person.
|
|
109
|
+
defamation:,
|
|
110
|
+
# Demeaning people because of a protected characteristic.
|
|
111
|
+
hate:,
|
|
112
|
+
# Chemical, biological, radiological, nuclear or explosive weapons.
|
|
113
|
+
indiscriminate_weapons:,
|
|
114
|
+
# Copyright or trademark infringement.
|
|
115
|
+
intellectual_property:,
|
|
116
|
+
# Imitation of the signature style of a specific living artist.
|
|
117
|
+
living_artist_style:,
|
|
118
|
+
# Age-coded language that suggests the subject is a minor.
|
|
119
|
+
minor_coded_language:,
|
|
120
|
+
# Non-consensual intimate imagery: undressing, nudifying or sexualising a real
|
|
121
|
+
# person.
|
|
122
|
+
non_consensual_intimate_imagery:,
|
|
123
|
+
# Non-violent crimes.
|
|
124
|
+
non_violent_crimes:,
|
|
125
|
+
# Sensitive private information about a person.
|
|
126
|
+
privacy:,
|
|
127
|
+
# An attempt to override or manipulate the instructions of the system.
|
|
128
|
+
prompt_injection:,
|
|
129
|
+
# The likeness of a real, identifiable, named person.
|
|
130
|
+
real_person_likeness:,
|
|
131
|
+
# Sex-related crimes.
|
|
132
|
+
sex_related_crimes:,
|
|
133
|
+
# Sexually explicit or pornographic content.
|
|
134
|
+
sexual_content:,
|
|
135
|
+
# Unqualified financial, medical, legal or electoral advice.
|
|
136
|
+
specialized_advice:,
|
|
137
|
+
# Suicide and self-harm.
|
|
138
|
+
suicide_and_self_harm:,
|
|
139
|
+
# Violent crimes.
|
|
140
|
+
violent_crimes:
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
sig do
|
|
145
|
+
override.returns(
|
|
146
|
+
{
|
|
147
|
+
child_sexual_exploitation: Float,
|
|
148
|
+
defamation: Float,
|
|
149
|
+
hate: Float,
|
|
150
|
+
indiscriminate_weapons: Float,
|
|
151
|
+
intellectual_property: Float,
|
|
152
|
+
living_artist_style: Float,
|
|
153
|
+
minor_coded_language: Float,
|
|
154
|
+
non_consensual_intimate_imagery: Float,
|
|
155
|
+
non_violent_crimes: Float,
|
|
156
|
+
privacy: Float,
|
|
157
|
+
prompt_injection: Float,
|
|
158
|
+
real_person_likeness: Float,
|
|
159
|
+
sex_related_crimes: Float,
|
|
160
|
+
sexual_content: Float,
|
|
161
|
+
specialized_advice: Float,
|
|
162
|
+
suicide_and_self_harm: Float,
|
|
163
|
+
violent_crimes: Float
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
def to_hash
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# The verdict. `allow` means the content passed. `deny` means block the content.
|
|
6
|
+
# `flag` means apply your own judgement. It is not a soft deny.
|
|
7
|
+
module ModerationDecision
|
|
8
|
+
extend Dodopayments::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
TaggedSymbol =
|
|
11
|
+
T.type_alias { T.all(Symbol, Dodopayments::ModerationDecision) }
|
|
12
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
13
|
+
|
|
14
|
+
ALLOW = T.let(:allow, Dodopayments::ModerationDecision::TaggedSymbol)
|
|
15
|
+
FLAG = T.let(:flag, Dodopayments::ModerationDecision::TaggedSymbol)
|
|
16
|
+
DENY = T.let(:deny, Dodopayments::ModerationDecision::TaggedSymbol)
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
override.returns(
|
|
20
|
+
T::Array[Dodopayments::ModerationDecision::TaggedSymbol]
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
def self.values
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# How a score was measured. `targeted` means a check for that one category
|
|
6
|
+
# measured it. `broad` means the general check that covers all categories measured
|
|
7
|
+
# it.
|
|
8
|
+
module ModerationProvenance
|
|
9
|
+
extend Dodopayments::Internal::Type::Enum
|
|
10
|
+
|
|
11
|
+
TaggedSymbol =
|
|
12
|
+
T.type_alias { T.all(Symbol, Dodopayments::ModerationProvenance) }
|
|
13
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
14
|
+
|
|
15
|
+
TARGETED =
|
|
16
|
+
T.let(:targeted, Dodopayments::ModerationProvenance::TaggedSymbol)
|
|
17
|
+
BROAD = T.let(:broad, Dodopayments::ModerationProvenance::TaggedSymbol)
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
override.returns(
|
|
21
|
+
T::Array[Dodopayments::ModerationProvenance::TaggedSymbol]
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
def self.values
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class ModerationRetrieveUsageParams < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Dodopayments::ModerationRetrieveUsageParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(request_options: Dodopayments::RequestOptions::OrHash).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
override.returns({ request_options: Dodopayments::RequestOptions })
|
|
27
|
+
end
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|