dodopayments 2.29.0 → 2.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/models/balance_ledger_entry.rb +3 -0
  6. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +3 -0
  7. data/lib/dodopayments/models/checkout_session_flags.rb +12 -1
  8. data/lib/dodopayments/models/checkout_session_preview_response.rb +86 -4
  9. data/lib/dodopayments/models/checkout_session_request.rb +4 -1
  10. data/lib/dodopayments/models/customers/email_log_item.rb +3 -2
  11. data/lib/dodopayments/models/customers/email_policies.rb +4 -3
  12. data/lib/dodopayments/models/discount_create_params.rb +11 -8
  13. data/lib/dodopayments/models/discount_update_params.rb +6 -5
  14. data/lib/dodopayments/models/moderation_category.rb +31 -0
  15. data/lib/dodopayments/models/moderation_category_provenance.rb +150 -0
  16. data/lib/dodopayments/models/moderation_category_scores.rb +150 -0
  17. data/lib/dodopayments/models/moderation_decision.rb +18 -0
  18. data/lib/dodopayments/models/moderation_provenance.rb +18 -0
  19. data/lib/dodopayments/models/moderation_retrieve_usage_params.rb +14 -0
  20. data/lib/dodopayments/models/moderation_retrieve_usage_response.rb +61 -0
  21. data/lib/dodopayments/models/moderation_screen_params.rb +44 -0
  22. data/lib/dodopayments/models/moderation_screen_response.rb +99 -0
  23. data/lib/dodopayments/models/payment.rb +25 -3
  24. data/lib/dodopayments/models/payment_list_response.rb +21 -1
  25. data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +5 -4
  26. data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +17 -1
  27. data/lib/dodopayments/models.rb +14 -0
  28. data/lib/dodopayments/resources/checkout_sessions.rb +2 -2
  29. data/lib/dodopayments/resources/moderation.rb +81 -0
  30. data/lib/dodopayments/resources/payouts/breakup/details.rb +4 -4
  31. data/lib/dodopayments/version.rb +1 -1
  32. data/lib/dodopayments.rb +10 -0
  33. data/rbi/dodopayments/client.rbi +3 -0
  34. data/rbi/dodopayments/models/balance_ledger_entry.rbi +15 -0
  35. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +15 -0
  36. data/rbi/dodopayments/models/checkout_session_flags.rbi +17 -0
  37. data/rbi/dodopayments/models/checkout_session_preview_response.rbi +130 -6
  38. data/rbi/dodopayments/models/checkout_session_request.rbi +6 -0
  39. data/rbi/dodopayments/models/customers/email_log_item.rbi +4 -2
  40. data/rbi/dodopayments/models/customers/email_policies.rbi +6 -4
  41. data/rbi/dodopayments/models/discount_create_params.rbi +18 -12
  42. data/rbi/dodopayments/models/discount_update_params.rbi +8 -6
  43. data/rbi/dodopayments/models/moderation_category.rbi +88 -0
  44. data/rbi/dodopayments/models/moderation_category_provenance.rbi +184 -0
  45. data/rbi/dodopayments/models/moderation_category_scores.rbi +171 -0
  46. data/rbi/dodopayments/models/moderation_decision.rbi +27 -0
  47. data/rbi/dodopayments/models/moderation_provenance.rbi +28 -0
  48. data/rbi/dodopayments/models/moderation_retrieve_usage_params.rbi +32 -0
  49. data/rbi/dodopayments/models/moderation_retrieve_usage_response.rbi +104 -0
  50. data/rbi/dodopayments/models/moderation_screen_params.rbi +68 -0
  51. data/rbi/dodopayments/models/moderation_screen_response.rbi +135 -0
  52. data/rbi/dodopayments/models/payment.rbi +30 -2
  53. data/rbi/dodopayments/models/payment_list_response.rbi +24 -0
  54. data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +8 -6
  55. data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +19 -2
  56. data/rbi/dodopayments/models.rbi +16 -0
  57. data/rbi/dodopayments/resources/checkout_sessions.rbi +6 -0
  58. data/rbi/dodopayments/resources/discounts.rbi +5 -3
  59. data/rbi/dodopayments/resources/moderation.rbi +64 -0
  60. data/rbi/dodopayments/resources/payouts/breakup/details.rbi +4 -4
  61. data/sig/dodopayments/client.rbs +2 -0
  62. data/sig/dodopayments/models/balance_ledger_entry.rbs +6 -0
  63. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +6 -0
  64. data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
  65. data/sig/dodopayments/models/checkout_session_preview_response.rbs +52 -0
  66. data/sig/dodopayments/models/moderation_category.rbs +46 -0
  67. data/sig/dodopayments/models/moderation_category_provenance.rbs +100 -0
  68. data/sig/dodopayments/models/moderation_category_scores.rbs +100 -0
  69. data/sig/dodopayments/models/moderation_decision.rbs +15 -0
  70. data/sig/dodopayments/models/moderation_provenance.rbs +14 -0
  71. data/sig/dodopayments/models/moderation_retrieve_usage_params.rbs +15 -0
  72. data/sig/dodopayments/models/moderation_retrieve_usage_response.rbs +42 -0
  73. data/sig/dodopayments/models/moderation_screen_params.rbs +32 -0
  74. data/sig/dodopayments/models/moderation_screen_response.rbs +65 -0
  75. data/sig/dodopayments/models/payment.rbs +10 -0
  76. data/sig/dodopayments/models/payment_list_response.rbs +10 -0
  77. data/sig/dodopayments/models.rbs +14 -0
  78. data/sig/dodopayments/resources/moderation.rbs +18 -0
  79. metadata +32 -2
@@ -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
@@ -0,0 +1,104 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class ModerationRetrieveUsageResponse < Dodopayments::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Dodopayments::Models::ModerationRetrieveUsageResponse,
10
+ Dodopayments::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Your billable screens per UTC day for the last 30 days, charged or not. A day
15
+ # with no screens is not in the list.
16
+ sig do
17
+ returns(
18
+ T::Array[Dodopayments::Models::ModerationRetrieveUsageResponse::Daily]
19
+ )
20
+ end
21
+ attr_accessor :daily
22
+
23
+ # Billable screens still needed to fill the next block of 1000. A full block is
24
+ # charged within one hour, so this value is 1000 when your unbilled screens fill
25
+ # whole blocks.
26
+ sig { returns(Integer) }
27
+ attr_accessor :screens_to_next_block
28
+
29
+ # Billable screens that Dodo Payments has not charged for yet.
30
+ sig { returns(Integer) }
31
+ attr_accessor :unbilled_screens
32
+
33
+ # Your moderation usage.
34
+ sig do
35
+ params(
36
+ daily:
37
+ T::Array[
38
+ Dodopayments::Models::ModerationRetrieveUsageResponse::Daily::OrHash
39
+ ],
40
+ screens_to_next_block: Integer,
41
+ unbilled_screens: Integer
42
+ ).returns(T.attached_class)
43
+ end
44
+ def self.new(
45
+ # Your billable screens per UTC day for the last 30 days, charged or not. A day
46
+ # with no screens is not in the list.
47
+ daily:,
48
+ # Billable screens still needed to fill the next block of 1000. A full block is
49
+ # charged within one hour, so this value is 1000 when your unbilled screens fill
50
+ # whole blocks.
51
+ screens_to_next_block:,
52
+ # Billable screens that Dodo Payments has not charged for yet.
53
+ unbilled_screens:
54
+ )
55
+ end
56
+
57
+ sig do
58
+ override.returns(
59
+ {
60
+ daily:
61
+ T::Array[
62
+ Dodopayments::Models::ModerationRetrieveUsageResponse::Daily
63
+ ],
64
+ screens_to_next_block: Integer,
65
+ unbilled_screens: Integer
66
+ }
67
+ )
68
+ end
69
+ def to_hash
70
+ end
71
+
72
+ class Daily < Dodopayments::Internal::Type::BaseModel
73
+ OrHash =
74
+ T.type_alias do
75
+ T.any(
76
+ Dodopayments::Models::ModerationRetrieveUsageResponse::Daily,
77
+ Dodopayments::Internal::AnyHash
78
+ )
79
+ end
80
+
81
+ # The UTC day.
82
+ sig { returns(Date) }
83
+ attr_accessor :date
84
+
85
+ # Billable screens on that day.
86
+ sig { returns(Integer) }
87
+ attr_accessor :screens
88
+
89
+ sig { params(date: Date, screens: Integer).returns(T.attached_class) }
90
+ def self.new(
91
+ # The UTC day.
92
+ date:,
93
+ # Billable screens on that day.
94
+ screens:
95
+ )
96
+ end
97
+
98
+ sig { override.returns({ date: Date, screens: Integer }) }
99
+ def to_hash
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end