moderation_api 2.33.0 → 2.35.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 +16 -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/content_submit_response.rb +119 -1
- 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/content_submit_response.rbi +226 -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/content_submit_response.rbs +72 -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,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
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookUpdateParams < 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::WebhookUpdateParams,
|
|
13
|
+
ModerationAPI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The ID of the webhook to update.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# The webhook's description
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_accessor :description
|
|
24
|
+
|
|
25
|
+
# Event types this webhook subscribes to. One webhook URL receives all events you
|
|
26
|
+
# list here.
|
|
27
|
+
sig do
|
|
28
|
+
returns(
|
|
29
|
+
T.nilable(
|
|
30
|
+
T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol]
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
attr_reader :event_types
|
|
35
|
+
|
|
36
|
+
sig do
|
|
37
|
+
params(
|
|
38
|
+
event_types:
|
|
39
|
+
T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol]
|
|
40
|
+
).void
|
|
41
|
+
end
|
|
42
|
+
attr_writer :event_types
|
|
43
|
+
|
|
44
|
+
# The webhook's name, used to identify it in the dashboard
|
|
45
|
+
sig { returns(T.nilable(String)) }
|
|
46
|
+
attr_reader :name
|
|
47
|
+
|
|
48
|
+
sig { params(name: String).void }
|
|
49
|
+
attr_writer :name
|
|
50
|
+
|
|
51
|
+
# The webhook's URL. We'll call this URL when an event occurs.
|
|
52
|
+
sig { returns(T.nilable(String)) }
|
|
53
|
+
attr_reader :url
|
|
54
|
+
|
|
55
|
+
sig { params(url: String).void }
|
|
56
|
+
attr_writer :url
|
|
57
|
+
|
|
58
|
+
sig do
|
|
59
|
+
params(
|
|
60
|
+
id: String,
|
|
61
|
+
description: T.nilable(String),
|
|
62
|
+
event_types:
|
|
63
|
+
T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol],
|
|
64
|
+
name: String,
|
|
65
|
+
url: String,
|
|
66
|
+
request_options: ModerationAPI::RequestOptions::OrHash
|
|
67
|
+
).returns(T.attached_class)
|
|
68
|
+
end
|
|
69
|
+
def self.new(
|
|
70
|
+
# The ID of the webhook to update.
|
|
71
|
+
id:,
|
|
72
|
+
# The webhook's description
|
|
73
|
+
description: nil,
|
|
74
|
+
# Event types this webhook subscribes to. One webhook URL receives all events you
|
|
75
|
+
# list here.
|
|
76
|
+
event_types: nil,
|
|
77
|
+
# The webhook's name, used to identify it in the dashboard
|
|
78
|
+
name: nil,
|
|
79
|
+
# The webhook's URL. We'll call this URL when an event occurs.
|
|
80
|
+
url: nil,
|
|
81
|
+
request_options: {}
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
sig do
|
|
86
|
+
override.returns(
|
|
87
|
+
{
|
|
88
|
+
id: String,
|
|
89
|
+
description: T.nilable(String),
|
|
90
|
+
event_types:
|
|
91
|
+
T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol],
|
|
92
|
+
name: String,
|
|
93
|
+
url: String,
|
|
94
|
+
request_options: ModerationAPI::RequestOptions
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
def to_hash
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
module EventType
|
|
102
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
103
|
+
|
|
104
|
+
TaggedSymbol =
|
|
105
|
+
T.type_alias do
|
|
106
|
+
T.all(Symbol, ModerationAPI::WebhookUpdateParams::EventType)
|
|
107
|
+
end
|
|
108
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
109
|
+
|
|
110
|
+
QUEUE_ITEM_NEW =
|
|
111
|
+
T.let(
|
|
112
|
+
:QUEUE_ITEM_NEW,
|
|
113
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
114
|
+
)
|
|
115
|
+
QUEUE_ITEM_COMPLETED =
|
|
116
|
+
T.let(
|
|
117
|
+
:QUEUE_ITEM_COMPLETED,
|
|
118
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
119
|
+
)
|
|
120
|
+
QUEUE_ITEM_ACTION =
|
|
121
|
+
T.let(
|
|
122
|
+
:QUEUE_ITEM_ACTION,
|
|
123
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
124
|
+
)
|
|
125
|
+
QUEUE_ITEM_REJECTED =
|
|
126
|
+
T.let(
|
|
127
|
+
:QUEUE_ITEM_REJECTED,
|
|
128
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
129
|
+
)
|
|
130
|
+
QUEUE_ITEM_ALLOWED =
|
|
131
|
+
T.let(
|
|
132
|
+
:QUEUE_ITEM_ALLOWED,
|
|
133
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
134
|
+
)
|
|
135
|
+
AUTHOR_BLOCKED =
|
|
136
|
+
T.let(
|
|
137
|
+
:AUTHOR_BLOCKED,
|
|
138
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
139
|
+
)
|
|
140
|
+
AUTHOR_UNBLOCKED =
|
|
141
|
+
T.let(
|
|
142
|
+
:AUTHOR_UNBLOCKED,
|
|
143
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
144
|
+
)
|
|
145
|
+
AUTHOR_SUSPENDED =
|
|
146
|
+
T.let(
|
|
147
|
+
:AUTHOR_SUSPENDED,
|
|
148
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
149
|
+
)
|
|
150
|
+
AUTHOR_UPDATED =
|
|
151
|
+
T.let(
|
|
152
|
+
:AUTHOR_UPDATED,
|
|
153
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
154
|
+
)
|
|
155
|
+
AUTHOR_TRUST_LEVEL_CHANGED =
|
|
156
|
+
T.let(
|
|
157
|
+
:AUTHOR_TRUST_LEVEL_CHANGED,
|
|
158
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
159
|
+
)
|
|
160
|
+
AUTHOR_ACTION =
|
|
161
|
+
T.let(
|
|
162
|
+
:AUTHOR_ACTION,
|
|
163
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
sig do
|
|
167
|
+
override.returns(
|
|
168
|
+
T::Array[
|
|
169
|
+
ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol
|
|
170
|
+
]
|
|
171
|
+
)
|
|
172
|
+
end
|
|
173
|
+
def self.values
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookUpdateResponse < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModerationAPI::Models::WebhookUpdateResponse,
|
|
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::WebhookUpdateResponse::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::WebhookUpdateResponse::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::WebhookUpdateResponse::EventType::OrSymbol
|
|
61
|
+
],
|
|
62
|
+
name: String,
|
|
63
|
+
payload_version:
|
|
64
|
+
ModerationAPI::Models::WebhookUpdateResponse::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::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
97
|
+
],
|
|
98
|
+
name: String,
|
|
99
|
+
payload_version:
|
|
100
|
+
ModerationAPI::Models::WebhookUpdateResponse::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::WebhookUpdateResponse::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::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
125
|
+
)
|
|
126
|
+
QUEUE_ITEM_COMPLETED =
|
|
127
|
+
T.let(
|
|
128
|
+
:QUEUE_ITEM_COMPLETED,
|
|
129
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
130
|
+
)
|
|
131
|
+
QUEUE_ITEM_ACTION =
|
|
132
|
+
T.let(
|
|
133
|
+
:QUEUE_ITEM_ACTION,
|
|
134
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
135
|
+
)
|
|
136
|
+
QUEUE_ITEM_REJECTED =
|
|
137
|
+
T.let(
|
|
138
|
+
:QUEUE_ITEM_REJECTED,
|
|
139
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
140
|
+
)
|
|
141
|
+
QUEUE_ITEM_ALLOWED =
|
|
142
|
+
T.let(
|
|
143
|
+
:QUEUE_ITEM_ALLOWED,
|
|
144
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
145
|
+
)
|
|
146
|
+
AUTHOR_BLOCKED =
|
|
147
|
+
T.let(
|
|
148
|
+
:AUTHOR_BLOCKED,
|
|
149
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
150
|
+
)
|
|
151
|
+
AUTHOR_UNBLOCKED =
|
|
152
|
+
T.let(
|
|
153
|
+
:AUTHOR_UNBLOCKED,
|
|
154
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
155
|
+
)
|
|
156
|
+
AUTHOR_SUSPENDED =
|
|
157
|
+
T.let(
|
|
158
|
+
:AUTHOR_SUSPENDED,
|
|
159
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
160
|
+
)
|
|
161
|
+
AUTHOR_UPDATED =
|
|
162
|
+
T.let(
|
|
163
|
+
:AUTHOR_UPDATED,
|
|
164
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
165
|
+
)
|
|
166
|
+
AUTHOR_TRUST_LEVEL_CHANGED =
|
|
167
|
+
T.let(
|
|
168
|
+
:AUTHOR_TRUST_LEVEL_CHANGED,
|
|
169
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
170
|
+
)
|
|
171
|
+
AUTHOR_ACTION =
|
|
172
|
+
T.let(
|
|
173
|
+
:AUTHOR_ACTION,
|
|
174
|
+
ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
sig do
|
|
178
|
+
override.returns(
|
|
179
|
+
T::Array[
|
|
180
|
+
ModerationAPI::Models::WebhookUpdateResponse::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::WebhookUpdateResponse::PayloadVersion
|
|
198
|
+
)
|
|
199
|
+
end
|
|
200
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
201
|
+
|
|
202
|
+
V1 =
|
|
203
|
+
T.let(
|
|
204
|
+
:V1,
|
|
205
|
+
ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::TaggedSymbol
|
|
206
|
+
)
|
|
207
|
+
V2 =
|
|
208
|
+
T.let(
|
|
209
|
+
:V2,
|
|
210
|
+
ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::TaggedSymbol
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
sig do
|
|
214
|
+
override.returns(
|
|
215
|
+
T::Array[
|
|
216
|
+
ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::TaggedSymbol
|
|
217
|
+
]
|
|
218
|
+
)
|
|
219
|
+
end
|
|
220
|
+
def self.values
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
end
|