moderation_api 2.33.0 → 2.34.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 +8 -0
- data/README.md +1 -1
- data/lib/moderation_api/client.rb +15 -0
- data/lib/moderation_api/models/content_stream_params.rb +29 -0
- data/lib/moderation_api/models/webhook_create_params.rb +73 -0
- data/lib/moderation_api/models/webhook_create_response.rb +107 -0
- data/lib/moderation_api/models/webhook_delete_params.rb +22 -0
- data/lib/moderation_api/models/webhook_delete_response.rb +25 -0
- data/lib/moderation_api/models/webhook_list_params.rb +14 -0
- data/lib/moderation_api/models/webhook_list_response.rb +110 -0
- data/lib/moderation_api/models/webhook_retrieve_params.rb +22 -0
- data/lib/moderation_api/models/webhook_retrieve_response.rb +107 -0
- data/lib/moderation_api/models/webhook_secret_retrieve_params.rb +14 -0
- data/lib/moderation_api/models/webhook_secret_retrieve_response.rb +22 -0
- data/lib/moderation_api/models/webhook_update_params.rb +81 -0
- data/lib/moderation_api/models/webhook_update_response.rb +107 -0
- data/lib/moderation_api/models.rb +14 -0
- data/lib/moderation_api/resources/content.rb +42 -0
- data/lib/moderation_api/resources/webhook_secret.rb +34 -0
- data/lib/moderation_api/resources/webhooks.rb +139 -0
- data/lib/moderation_api/version.rb +1 -1
- data/lib/moderation_api.rb +15 -0
- data/rbi/moderation_api/client.rbi +11 -0
- data/rbi/moderation_api/models/content_stream_params.rbi +76 -0
- data/rbi/moderation_api/models/webhook_create_params.rbi +154 -0
- data/rbi/moderation_api/models/webhook_create_response.rbi +225 -0
- data/rbi/moderation_api/models/webhook_delete_params.rbi +43 -0
- data/rbi/moderation_api/models/webhook_delete_response.rbi +36 -0
- data/rbi/moderation_api/models/webhook_list_params.rbi +32 -0
- data/rbi/moderation_api/models/webhook_list_response.rbi +233 -0
- data/rbi/moderation_api/models/webhook_retrieve_params.rbi +43 -0
- data/rbi/moderation_api/models/webhook_retrieve_response.rbi +225 -0
- data/rbi/moderation_api/models/webhook_secret_retrieve_params.rbi +32 -0
- data/rbi/moderation_api/models/webhook_secret_retrieve_response.rbi +34 -0
- data/rbi/moderation_api/models/webhook_update_params.rbi +178 -0
- data/rbi/moderation_api/models/webhook_update_response.rbi +225 -0
- data/rbi/moderation_api/models.rbi +15 -0
- data/rbi/moderation_api/resources/content.rbi +34 -0
- data/rbi/moderation_api/resources/webhook_secret.rbi +23 -0
- data/rbi/moderation_api/resources/webhooks.rbi +105 -0
- data/sig/moderation_api/client.rbs +6 -0
- data/sig/moderation_api/models/content_stream_params.rbs +36 -0
- data/sig/moderation_api/models/webhook_create_params.rbs +72 -0
- data/sig/moderation_api/models/webhook_create_response.rbs +92 -0
- data/sig/moderation_api/models/webhook_delete_params.rbs +23 -0
- data/sig/moderation_api/models/webhook_delete_response.rbs +15 -0
- data/sig/moderation_api/models/webhook_list_params.rbs +15 -0
- data/sig/moderation_api/models/webhook_list_response.rbs +97 -0
- data/sig/moderation_api/models/webhook_retrieve_params.rbs +23 -0
- data/sig/moderation_api/models/webhook_retrieve_response.rbs +92 -0
- data/sig/moderation_api/models/webhook_secret_retrieve_params.rbs +15 -0
- data/sig/moderation_api/models/webhook_secret_retrieve_response.rbs +13 -0
- data/sig/moderation_api/models/webhook_update_params.rbs +85 -0
- data/sig/moderation_api/models/webhook_update_response.rbs +92 -0
- data/sig/moderation_api/models.rbs +14 -0
- data/sig/moderation_api/resources/content.rbs +5 -0
- data/sig/moderation_api/resources/webhook_secret.rbs +11 -0
- data/sig/moderation_api/resources/webhooks.rbs +38 -0
- metadata +47 -2
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookListResponseItem < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModerationAPI::Models::WebhookListResponseItem,
|
|
10
|
+
ModerationAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the webhook.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# The date the webhook was created.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :created_at
|
|
21
|
+
|
|
22
|
+
# Event types this webhook subscribes to. Empty for legacy v1 webhooks, which
|
|
23
|
+
# subscribe via their single deprecated `type` instead.
|
|
24
|
+
sig do
|
|
25
|
+
returns(
|
|
26
|
+
T::Array[
|
|
27
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
28
|
+
]
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
attr_accessor :event_types
|
|
32
|
+
|
|
33
|
+
# The webhook's name.
|
|
34
|
+
sig { returns(String) }
|
|
35
|
+
attr_accessor :name
|
|
36
|
+
|
|
37
|
+
# Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat
|
|
38
|
+
# shape and is read-only via this API.
|
|
39
|
+
sig do
|
|
40
|
+
returns(
|
|
41
|
+
ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
attr_accessor :payload_version
|
|
45
|
+
|
|
46
|
+
# The URL we call when a subscribed event occurs.
|
|
47
|
+
sig { returns(String) }
|
|
48
|
+
attr_accessor :url
|
|
49
|
+
|
|
50
|
+
# The webhook's description.
|
|
51
|
+
sig { returns(T.nilable(String)) }
|
|
52
|
+
attr_accessor :description
|
|
53
|
+
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
id: String,
|
|
57
|
+
created_at: String,
|
|
58
|
+
event_types:
|
|
59
|
+
T::Array[
|
|
60
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::OrSymbol
|
|
61
|
+
],
|
|
62
|
+
name: String,
|
|
63
|
+
payload_version:
|
|
64
|
+
ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::OrSymbol,
|
|
65
|
+
url: String,
|
|
66
|
+
description: T.nilable(String)
|
|
67
|
+
).returns(T.attached_class)
|
|
68
|
+
end
|
|
69
|
+
def self.new(
|
|
70
|
+
# The ID of the webhook.
|
|
71
|
+
id:,
|
|
72
|
+
# The date the webhook was created.
|
|
73
|
+
created_at:,
|
|
74
|
+
# Event types this webhook subscribes to. Empty for legacy v1 webhooks, which
|
|
75
|
+
# subscribe via their single deprecated `type` instead.
|
|
76
|
+
event_types:,
|
|
77
|
+
# The webhook's name.
|
|
78
|
+
name:,
|
|
79
|
+
# Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat
|
|
80
|
+
# shape and is read-only via this API.
|
|
81
|
+
payload_version:,
|
|
82
|
+
# The URL we call when a subscribed event occurs.
|
|
83
|
+
url:,
|
|
84
|
+
# The webhook's description.
|
|
85
|
+
description: nil
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
sig do
|
|
90
|
+
override.returns(
|
|
91
|
+
{
|
|
92
|
+
id: String,
|
|
93
|
+
created_at: String,
|
|
94
|
+
event_types:
|
|
95
|
+
T::Array[
|
|
96
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
97
|
+
],
|
|
98
|
+
name: String,
|
|
99
|
+
payload_version:
|
|
100
|
+
ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol,
|
|
101
|
+
url: String,
|
|
102
|
+
description: T.nilable(String)
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
def to_hash
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
module EventType
|
|
110
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
111
|
+
|
|
112
|
+
TaggedSymbol =
|
|
113
|
+
T.type_alias do
|
|
114
|
+
T.all(
|
|
115
|
+
Symbol,
|
|
116
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
120
|
+
|
|
121
|
+
QUEUE_ITEM_NEW =
|
|
122
|
+
T.let(
|
|
123
|
+
:QUEUE_ITEM_NEW,
|
|
124
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
125
|
+
)
|
|
126
|
+
QUEUE_ITEM_COMPLETED =
|
|
127
|
+
T.let(
|
|
128
|
+
:QUEUE_ITEM_COMPLETED,
|
|
129
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
130
|
+
)
|
|
131
|
+
QUEUE_ITEM_ACTION =
|
|
132
|
+
T.let(
|
|
133
|
+
:QUEUE_ITEM_ACTION,
|
|
134
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
135
|
+
)
|
|
136
|
+
QUEUE_ITEM_REJECTED =
|
|
137
|
+
T.let(
|
|
138
|
+
:QUEUE_ITEM_REJECTED,
|
|
139
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
140
|
+
)
|
|
141
|
+
QUEUE_ITEM_ALLOWED =
|
|
142
|
+
T.let(
|
|
143
|
+
:QUEUE_ITEM_ALLOWED,
|
|
144
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
145
|
+
)
|
|
146
|
+
AUTHOR_BLOCKED =
|
|
147
|
+
T.let(
|
|
148
|
+
:AUTHOR_BLOCKED,
|
|
149
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
150
|
+
)
|
|
151
|
+
AUTHOR_UNBLOCKED =
|
|
152
|
+
T.let(
|
|
153
|
+
:AUTHOR_UNBLOCKED,
|
|
154
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
155
|
+
)
|
|
156
|
+
AUTHOR_SUSPENDED =
|
|
157
|
+
T.let(
|
|
158
|
+
:AUTHOR_SUSPENDED,
|
|
159
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
160
|
+
)
|
|
161
|
+
AUTHOR_UPDATED =
|
|
162
|
+
T.let(
|
|
163
|
+
:AUTHOR_UPDATED,
|
|
164
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
165
|
+
)
|
|
166
|
+
AUTHOR_TRUST_LEVEL_CHANGED =
|
|
167
|
+
T.let(
|
|
168
|
+
:AUTHOR_TRUST_LEVEL_CHANGED,
|
|
169
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
170
|
+
)
|
|
171
|
+
AUTHOR_ACTION =
|
|
172
|
+
T.let(
|
|
173
|
+
:AUTHOR_ACTION,
|
|
174
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
sig do
|
|
178
|
+
override.returns(
|
|
179
|
+
T::Array[
|
|
180
|
+
ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol
|
|
181
|
+
]
|
|
182
|
+
)
|
|
183
|
+
end
|
|
184
|
+
def self.values
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat
|
|
189
|
+
# shape and is read-only via this API.
|
|
190
|
+
module PayloadVersion
|
|
191
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
192
|
+
|
|
193
|
+
TaggedSymbol =
|
|
194
|
+
T.type_alias do
|
|
195
|
+
T.all(
|
|
196
|
+
Symbol,
|
|
197
|
+
ModerationAPI::Models::WebhookListResponseItem::PayloadVersion
|
|
198
|
+
)
|
|
199
|
+
end
|
|
200
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
201
|
+
|
|
202
|
+
V1 =
|
|
203
|
+
T.let(
|
|
204
|
+
:V1,
|
|
205
|
+
ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol
|
|
206
|
+
)
|
|
207
|
+
V2 =
|
|
208
|
+
T.let(
|
|
209
|
+
:V2,
|
|
210
|
+
ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
sig do
|
|
214
|
+
override.returns(
|
|
215
|
+
T::Array[
|
|
216
|
+
ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol
|
|
217
|
+
]
|
|
218
|
+
)
|
|
219
|
+
end
|
|
220
|
+
def self.values
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
WebhookListResponse =
|
|
226
|
+
T.let(
|
|
227
|
+
ModerationAPI::Internal::Type::ArrayOf[
|
|
228
|
+
ModerationAPI::Models::WebhookListResponseItem
|
|
229
|
+
],
|
|
230
|
+
ModerationAPI::Internal::Type::Converter
|
|
231
|
+
)
|
|
232
|
+
end
|
|
233
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookRetrieveParams < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
extend ModerationAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include ModerationAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
ModerationAPI::WebhookRetrieveParams,
|
|
13
|
+
ModerationAPI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The ID of the webhook to get.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
id: String,
|
|
24
|
+
request_options: ModerationAPI::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(
|
|
28
|
+
# The ID of the webhook to get.
|
|
29
|
+
id:,
|
|
30
|
+
request_options: {}
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{ id: String, request_options: ModerationAPI::RequestOptions }
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
def to_hash
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModerationAPI::Models::WebhookRetrieveResponse,
|
|
10
|
+
ModerationAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the webhook.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# The date the webhook was created.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :created_at
|
|
21
|
+
|
|
22
|
+
# Event types this webhook subscribes to. Empty for legacy v1 webhooks, which
|
|
23
|
+
# subscribe via their single deprecated `type` instead.
|
|
24
|
+
sig do
|
|
25
|
+
returns(
|
|
26
|
+
T::Array[
|
|
27
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
28
|
+
]
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
attr_accessor :event_types
|
|
32
|
+
|
|
33
|
+
# The webhook's name.
|
|
34
|
+
sig { returns(String) }
|
|
35
|
+
attr_accessor :name
|
|
36
|
+
|
|
37
|
+
# Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat
|
|
38
|
+
# shape and is read-only via this API.
|
|
39
|
+
sig do
|
|
40
|
+
returns(
|
|
41
|
+
ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
attr_accessor :payload_version
|
|
45
|
+
|
|
46
|
+
# The URL we call when a subscribed event occurs.
|
|
47
|
+
sig { returns(String) }
|
|
48
|
+
attr_accessor :url
|
|
49
|
+
|
|
50
|
+
# The webhook's description.
|
|
51
|
+
sig { returns(T.nilable(String)) }
|
|
52
|
+
attr_accessor :description
|
|
53
|
+
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
id: String,
|
|
57
|
+
created_at: String,
|
|
58
|
+
event_types:
|
|
59
|
+
T::Array[
|
|
60
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::OrSymbol
|
|
61
|
+
],
|
|
62
|
+
name: String,
|
|
63
|
+
payload_version:
|
|
64
|
+
ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::OrSymbol,
|
|
65
|
+
url: String,
|
|
66
|
+
description: T.nilable(String)
|
|
67
|
+
).returns(T.attached_class)
|
|
68
|
+
end
|
|
69
|
+
def self.new(
|
|
70
|
+
# The ID of the webhook.
|
|
71
|
+
id:,
|
|
72
|
+
# The date the webhook was created.
|
|
73
|
+
created_at:,
|
|
74
|
+
# Event types this webhook subscribes to. Empty for legacy v1 webhooks, which
|
|
75
|
+
# subscribe via their single deprecated `type` instead.
|
|
76
|
+
event_types:,
|
|
77
|
+
# The webhook's name.
|
|
78
|
+
name:,
|
|
79
|
+
# Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat
|
|
80
|
+
# shape and is read-only via this API.
|
|
81
|
+
payload_version:,
|
|
82
|
+
# The URL we call when a subscribed event occurs.
|
|
83
|
+
url:,
|
|
84
|
+
# The webhook's description.
|
|
85
|
+
description: nil
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
sig do
|
|
90
|
+
override.returns(
|
|
91
|
+
{
|
|
92
|
+
id: String,
|
|
93
|
+
created_at: String,
|
|
94
|
+
event_types:
|
|
95
|
+
T::Array[
|
|
96
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
97
|
+
],
|
|
98
|
+
name: String,
|
|
99
|
+
payload_version:
|
|
100
|
+
ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol,
|
|
101
|
+
url: String,
|
|
102
|
+
description: T.nilable(String)
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
def to_hash
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
module EventType
|
|
110
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
111
|
+
|
|
112
|
+
TaggedSymbol =
|
|
113
|
+
T.type_alias do
|
|
114
|
+
T.all(
|
|
115
|
+
Symbol,
|
|
116
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
120
|
+
|
|
121
|
+
QUEUE_ITEM_NEW =
|
|
122
|
+
T.let(
|
|
123
|
+
:QUEUE_ITEM_NEW,
|
|
124
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
125
|
+
)
|
|
126
|
+
QUEUE_ITEM_COMPLETED =
|
|
127
|
+
T.let(
|
|
128
|
+
:QUEUE_ITEM_COMPLETED,
|
|
129
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
130
|
+
)
|
|
131
|
+
QUEUE_ITEM_ACTION =
|
|
132
|
+
T.let(
|
|
133
|
+
:QUEUE_ITEM_ACTION,
|
|
134
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
135
|
+
)
|
|
136
|
+
QUEUE_ITEM_REJECTED =
|
|
137
|
+
T.let(
|
|
138
|
+
:QUEUE_ITEM_REJECTED,
|
|
139
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
140
|
+
)
|
|
141
|
+
QUEUE_ITEM_ALLOWED =
|
|
142
|
+
T.let(
|
|
143
|
+
:QUEUE_ITEM_ALLOWED,
|
|
144
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
145
|
+
)
|
|
146
|
+
AUTHOR_BLOCKED =
|
|
147
|
+
T.let(
|
|
148
|
+
:AUTHOR_BLOCKED,
|
|
149
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
150
|
+
)
|
|
151
|
+
AUTHOR_UNBLOCKED =
|
|
152
|
+
T.let(
|
|
153
|
+
:AUTHOR_UNBLOCKED,
|
|
154
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
155
|
+
)
|
|
156
|
+
AUTHOR_SUSPENDED =
|
|
157
|
+
T.let(
|
|
158
|
+
:AUTHOR_SUSPENDED,
|
|
159
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
160
|
+
)
|
|
161
|
+
AUTHOR_UPDATED =
|
|
162
|
+
T.let(
|
|
163
|
+
:AUTHOR_UPDATED,
|
|
164
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
165
|
+
)
|
|
166
|
+
AUTHOR_TRUST_LEVEL_CHANGED =
|
|
167
|
+
T.let(
|
|
168
|
+
:AUTHOR_TRUST_LEVEL_CHANGED,
|
|
169
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
170
|
+
)
|
|
171
|
+
AUTHOR_ACTION =
|
|
172
|
+
T.let(
|
|
173
|
+
:AUTHOR_ACTION,
|
|
174
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
sig do
|
|
178
|
+
override.returns(
|
|
179
|
+
T::Array[
|
|
180
|
+
ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol
|
|
181
|
+
]
|
|
182
|
+
)
|
|
183
|
+
end
|
|
184
|
+
def self.values
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat
|
|
189
|
+
# shape and is read-only via this API.
|
|
190
|
+
module PayloadVersion
|
|
191
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
192
|
+
|
|
193
|
+
TaggedSymbol =
|
|
194
|
+
T.type_alias do
|
|
195
|
+
T.all(
|
|
196
|
+
Symbol,
|
|
197
|
+
ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion
|
|
198
|
+
)
|
|
199
|
+
end
|
|
200
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
201
|
+
|
|
202
|
+
V1 =
|
|
203
|
+
T.let(
|
|
204
|
+
:V1,
|
|
205
|
+
ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol
|
|
206
|
+
)
|
|
207
|
+
V2 =
|
|
208
|
+
T.let(
|
|
209
|
+
:V2,
|
|
210
|
+
ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
sig do
|
|
214
|
+
override.returns(
|
|
215
|
+
T::Array[
|
|
216
|
+
ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol
|
|
217
|
+
]
|
|
218
|
+
)
|
|
219
|
+
end
|
|
220
|
+
def self.values
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookSecretRetrieveParams < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
extend ModerationAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include ModerationAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
ModerationAPI::WebhookSecretRetrieveParams,
|
|
13
|
+
ModerationAPI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(request_options: ModerationAPI::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: ModerationAPI::RequestOptions })
|
|
27
|
+
end
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookSecretRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModerationAPI::Models::WebhookSecretRetrieveResponse,
|
|
10
|
+
ModerationAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The signing secret for this project. Every webhook delivery is signed with
|
|
15
|
+
# HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature`
|
|
16
|
+
# header.
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :secret
|
|
19
|
+
|
|
20
|
+
sig { params(secret: String).returns(T.attached_class) }
|
|
21
|
+
def self.new(
|
|
22
|
+
# The signing secret for this project. Every webhook delivery is signed with
|
|
23
|
+
# HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature`
|
|
24
|
+
# header.
|
|
25
|
+
secret:
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig { override.returns({ secret: String }) }
|
|
30
|
+
def to_hash
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|