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 WebhookCreateResponse < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModerationAPI::Models::WebhookCreateResponse,
|
|
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::WebhookCreateResponse::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::WebhookCreateResponse::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::WebhookCreateResponse::EventType::OrSymbol
|
|
61
|
+
],
|
|
62
|
+
name: String,
|
|
63
|
+
payload_version:
|
|
64
|
+
ModerationAPI::Models::WebhookCreateResponse::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::WebhookCreateResponse::EventType::TaggedSymbol
|
|
97
|
+
],
|
|
98
|
+
name: String,
|
|
99
|
+
payload_version:
|
|
100
|
+
ModerationAPI::Models::WebhookCreateResponse::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::WebhookCreateResponse::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::WebhookCreateResponse::EventType::TaggedSymbol
|
|
125
|
+
)
|
|
126
|
+
QUEUE_ITEM_COMPLETED =
|
|
127
|
+
T.let(
|
|
128
|
+
:QUEUE_ITEM_COMPLETED,
|
|
129
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
130
|
+
)
|
|
131
|
+
QUEUE_ITEM_ACTION =
|
|
132
|
+
T.let(
|
|
133
|
+
:QUEUE_ITEM_ACTION,
|
|
134
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
135
|
+
)
|
|
136
|
+
QUEUE_ITEM_REJECTED =
|
|
137
|
+
T.let(
|
|
138
|
+
:QUEUE_ITEM_REJECTED,
|
|
139
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
140
|
+
)
|
|
141
|
+
QUEUE_ITEM_ALLOWED =
|
|
142
|
+
T.let(
|
|
143
|
+
:QUEUE_ITEM_ALLOWED,
|
|
144
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
145
|
+
)
|
|
146
|
+
AUTHOR_BLOCKED =
|
|
147
|
+
T.let(
|
|
148
|
+
:AUTHOR_BLOCKED,
|
|
149
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
150
|
+
)
|
|
151
|
+
AUTHOR_UNBLOCKED =
|
|
152
|
+
T.let(
|
|
153
|
+
:AUTHOR_UNBLOCKED,
|
|
154
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
155
|
+
)
|
|
156
|
+
AUTHOR_SUSPENDED =
|
|
157
|
+
T.let(
|
|
158
|
+
:AUTHOR_SUSPENDED,
|
|
159
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
160
|
+
)
|
|
161
|
+
AUTHOR_UPDATED =
|
|
162
|
+
T.let(
|
|
163
|
+
:AUTHOR_UPDATED,
|
|
164
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
165
|
+
)
|
|
166
|
+
AUTHOR_TRUST_LEVEL_CHANGED =
|
|
167
|
+
T.let(
|
|
168
|
+
:AUTHOR_TRUST_LEVEL_CHANGED,
|
|
169
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
170
|
+
)
|
|
171
|
+
AUTHOR_ACTION =
|
|
172
|
+
T.let(
|
|
173
|
+
:AUTHOR_ACTION,
|
|
174
|
+
ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
sig do
|
|
178
|
+
override.returns(
|
|
179
|
+
T::Array[
|
|
180
|
+
ModerationAPI::Models::WebhookCreateResponse::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::WebhookCreateResponse::PayloadVersion
|
|
198
|
+
)
|
|
199
|
+
end
|
|
200
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
201
|
+
|
|
202
|
+
V1 =
|
|
203
|
+
T.let(
|
|
204
|
+
:V1,
|
|
205
|
+
ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::TaggedSymbol
|
|
206
|
+
)
|
|
207
|
+
V2 =
|
|
208
|
+
T.let(
|
|
209
|
+
:V2,
|
|
210
|
+
ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::TaggedSymbol
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
sig do
|
|
214
|
+
override.returns(
|
|
215
|
+
T::Array[
|
|
216
|
+
ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::TaggedSymbol
|
|
217
|
+
]
|
|
218
|
+
)
|
|
219
|
+
end
|
|
220
|
+
def self.values
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookDeleteParams < 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::WebhookDeleteParams,
|
|
13
|
+
ModerationAPI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The ID of the webhook to delete.
|
|
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 delete.
|
|
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,36 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookDeleteResponse < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ModerationAPI::Models::WebhookDeleteResponse,
|
|
10
|
+
ModerationAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The ID of the webhook.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# Whether the webhook was deleted.
|
|
19
|
+
sig { returns(T::Boolean) }
|
|
20
|
+
attr_accessor :deleted
|
|
21
|
+
|
|
22
|
+
sig { params(id: String, deleted: T::Boolean).returns(T.attached_class) }
|
|
23
|
+
def self.new(
|
|
24
|
+
# The ID of the webhook.
|
|
25
|
+
id:,
|
|
26
|
+
# Whether the webhook was deleted.
|
|
27
|
+
deleted:
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig { override.returns({ id: String, deleted: T::Boolean }) }
|
|
32
|
+
def to_hash
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ModerationAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookListParams < 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::WebhookListParams,
|
|
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,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
|