moderation_api 2.32.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 +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/queue_retrieve_response.rb +13 -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/queue_retrieve_response.rbi +18 -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/queue_retrieve_response.rbs +14 -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,72 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_create_params =
|
|
4
|
+
{
|
|
5
|
+
event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type],
|
|
6
|
+
name: String,
|
|
7
|
+
url: String,
|
|
8
|
+
description: String?
|
|
9
|
+
}
|
|
10
|
+
& ModerationAPI::Internal::Type::request_parameters
|
|
11
|
+
|
|
12
|
+
class WebhookCreateParams < ModerationAPI::Internal::Type::BaseModel
|
|
13
|
+
extend ModerationAPI::Internal::Type::RequestParameters::Converter
|
|
14
|
+
include ModerationAPI::Internal::Type::RequestParameters
|
|
15
|
+
|
|
16
|
+
attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type]
|
|
17
|
+
|
|
18
|
+
attr_accessor name: String
|
|
19
|
+
|
|
20
|
+
attr_accessor url: String
|
|
21
|
+
|
|
22
|
+
attr_accessor description: String?
|
|
23
|
+
|
|
24
|
+
def initialize: (
|
|
25
|
+
event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type],
|
|
26
|
+
name: String,
|
|
27
|
+
url: String,
|
|
28
|
+
?description: String?,
|
|
29
|
+
?request_options: ModerationAPI::request_opts
|
|
30
|
+
) -> void
|
|
31
|
+
|
|
32
|
+
def to_hash: -> {
|
|
33
|
+
event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type],
|
|
34
|
+
name: String,
|
|
35
|
+
url: String,
|
|
36
|
+
description: String?,
|
|
37
|
+
request_options: ModerationAPI::RequestOptions
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type event_type =
|
|
41
|
+
:QUEUE_ITEM_NEW
|
|
42
|
+
| :QUEUE_ITEM_COMPLETED
|
|
43
|
+
| :QUEUE_ITEM_ACTION
|
|
44
|
+
| :QUEUE_ITEM_REJECTED
|
|
45
|
+
| :QUEUE_ITEM_ALLOWED
|
|
46
|
+
| :AUTHOR_BLOCKED
|
|
47
|
+
| :AUTHOR_UNBLOCKED
|
|
48
|
+
| :AUTHOR_SUSPENDED
|
|
49
|
+
| :AUTHOR_UPDATED
|
|
50
|
+
| :AUTHOR_TRUST_LEVEL_CHANGED
|
|
51
|
+
| :AUTHOR_ACTION
|
|
52
|
+
|
|
53
|
+
module EventType
|
|
54
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
55
|
+
|
|
56
|
+
QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW
|
|
57
|
+
QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED
|
|
58
|
+
QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION
|
|
59
|
+
QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED
|
|
60
|
+
QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED
|
|
61
|
+
AUTHOR_BLOCKED: :AUTHOR_BLOCKED
|
|
62
|
+
AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED
|
|
63
|
+
AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED
|
|
64
|
+
AUTHOR_UPDATED: :AUTHOR_UPDATED
|
|
65
|
+
AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED
|
|
66
|
+
AUTHOR_ACTION: :AUTHOR_ACTION
|
|
67
|
+
|
|
68
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookCreateParams::event_type]
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_create_response =
|
|
4
|
+
{
|
|
5
|
+
id: String,
|
|
6
|
+
created_at: String,
|
|
7
|
+
event_types: ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type],
|
|
8
|
+
name: String,
|
|
9
|
+
payload_version: ModerationAPI::Models::WebhookCreateResponse::payload_version,
|
|
10
|
+
url: String,
|
|
11
|
+
description: String?
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class WebhookCreateResponse < ModerationAPI::Internal::Type::BaseModel
|
|
15
|
+
attr_accessor id: String
|
|
16
|
+
|
|
17
|
+
attr_accessor created_at: String
|
|
18
|
+
|
|
19
|
+
attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type]
|
|
20
|
+
|
|
21
|
+
attr_accessor name: String
|
|
22
|
+
|
|
23
|
+
attr_accessor payload_version: ModerationAPI::Models::WebhookCreateResponse::payload_version
|
|
24
|
+
|
|
25
|
+
attr_accessor url: String
|
|
26
|
+
|
|
27
|
+
attr_accessor description: String?
|
|
28
|
+
|
|
29
|
+
def initialize: (
|
|
30
|
+
id: String,
|
|
31
|
+
created_at: String,
|
|
32
|
+
event_types: ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type],
|
|
33
|
+
name: String,
|
|
34
|
+
payload_version: ModerationAPI::Models::WebhookCreateResponse::payload_version,
|
|
35
|
+
url: String,
|
|
36
|
+
?description: String?
|
|
37
|
+
) -> void
|
|
38
|
+
|
|
39
|
+
def to_hash: -> {
|
|
40
|
+
id: String,
|
|
41
|
+
created_at: String,
|
|
42
|
+
event_types: ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type],
|
|
43
|
+
name: String,
|
|
44
|
+
payload_version: ModerationAPI::Models::WebhookCreateResponse::payload_version,
|
|
45
|
+
url: String,
|
|
46
|
+
description: String?
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type event_type =
|
|
50
|
+
:QUEUE_ITEM_NEW
|
|
51
|
+
| :QUEUE_ITEM_COMPLETED
|
|
52
|
+
| :QUEUE_ITEM_ACTION
|
|
53
|
+
| :QUEUE_ITEM_REJECTED
|
|
54
|
+
| :QUEUE_ITEM_ALLOWED
|
|
55
|
+
| :AUTHOR_BLOCKED
|
|
56
|
+
| :AUTHOR_UNBLOCKED
|
|
57
|
+
| :AUTHOR_SUSPENDED
|
|
58
|
+
| :AUTHOR_UPDATED
|
|
59
|
+
| :AUTHOR_TRUST_LEVEL_CHANGED
|
|
60
|
+
| :AUTHOR_ACTION
|
|
61
|
+
|
|
62
|
+
module EventType
|
|
63
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
64
|
+
|
|
65
|
+
QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW
|
|
66
|
+
QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED
|
|
67
|
+
QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION
|
|
68
|
+
QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED
|
|
69
|
+
QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED
|
|
70
|
+
AUTHOR_BLOCKED: :AUTHOR_BLOCKED
|
|
71
|
+
AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED
|
|
72
|
+
AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED
|
|
73
|
+
AUTHOR_UPDATED: :AUTHOR_UPDATED
|
|
74
|
+
AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED
|
|
75
|
+
AUTHOR_ACTION: :AUTHOR_ACTION
|
|
76
|
+
|
|
77
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
type payload_version = :V1 | :V2
|
|
81
|
+
|
|
82
|
+
module PayloadVersion
|
|
83
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
84
|
+
|
|
85
|
+
V1: :V1
|
|
86
|
+
V2: :V2
|
|
87
|
+
|
|
88
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookCreateResponse::payload_version]
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_delete_params =
|
|
4
|
+
{ id: String } & ModerationAPI::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class WebhookDeleteParams < ModerationAPI::Internal::Type::BaseModel
|
|
7
|
+
extend ModerationAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include ModerationAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
attr_accessor id: String
|
|
11
|
+
|
|
12
|
+
def initialize: (
|
|
13
|
+
id: String,
|
|
14
|
+
?request_options: ModerationAPI::request_opts
|
|
15
|
+
) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> {
|
|
18
|
+
id: String,
|
|
19
|
+
request_options: ModerationAPI::RequestOptions
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_delete_response = { id: String, deleted: bool }
|
|
4
|
+
|
|
5
|
+
class WebhookDeleteResponse < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
attr_accessor id: String
|
|
7
|
+
|
|
8
|
+
attr_accessor deleted: bool
|
|
9
|
+
|
|
10
|
+
def initialize: (id: String, deleted: bool) -> void
|
|
11
|
+
|
|
12
|
+
def to_hash: -> { id: String, deleted: bool }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_list_params =
|
|
4
|
+
{ } & ModerationAPI::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class WebhookListParams < ModerationAPI::Internal::Type::BaseModel
|
|
7
|
+
extend ModerationAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include ModerationAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
def initialize: (?request_options: ModerationAPI::request_opts) -> void
|
|
11
|
+
|
|
12
|
+
def to_hash: -> { request_options: ModerationAPI::RequestOptions }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_list_response_item =
|
|
4
|
+
{
|
|
5
|
+
id: String,
|
|
6
|
+
created_at: String,
|
|
7
|
+
event_types: ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type],
|
|
8
|
+
name: String,
|
|
9
|
+
payload_version: ModerationAPI::Models::WebhookListResponseItem::payload_version,
|
|
10
|
+
url: String,
|
|
11
|
+
description: String?
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class WebhookListResponseItem < ModerationAPI::Internal::Type::BaseModel
|
|
15
|
+
attr_accessor id: String
|
|
16
|
+
|
|
17
|
+
attr_accessor created_at: String
|
|
18
|
+
|
|
19
|
+
attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type]
|
|
20
|
+
|
|
21
|
+
attr_accessor name: String
|
|
22
|
+
|
|
23
|
+
attr_accessor payload_version: ModerationAPI::Models::WebhookListResponseItem::payload_version
|
|
24
|
+
|
|
25
|
+
attr_accessor url: String
|
|
26
|
+
|
|
27
|
+
attr_accessor description: String?
|
|
28
|
+
|
|
29
|
+
def initialize: (
|
|
30
|
+
id: String,
|
|
31
|
+
created_at: String,
|
|
32
|
+
event_types: ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type],
|
|
33
|
+
name: String,
|
|
34
|
+
payload_version: ModerationAPI::Models::WebhookListResponseItem::payload_version,
|
|
35
|
+
url: String,
|
|
36
|
+
?description: String?
|
|
37
|
+
) -> void
|
|
38
|
+
|
|
39
|
+
def to_hash: -> {
|
|
40
|
+
id: String,
|
|
41
|
+
created_at: String,
|
|
42
|
+
event_types: ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type],
|
|
43
|
+
name: String,
|
|
44
|
+
payload_version: ModerationAPI::Models::WebhookListResponseItem::payload_version,
|
|
45
|
+
url: String,
|
|
46
|
+
description: String?
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type event_type =
|
|
50
|
+
:QUEUE_ITEM_NEW
|
|
51
|
+
| :QUEUE_ITEM_COMPLETED
|
|
52
|
+
| :QUEUE_ITEM_ACTION
|
|
53
|
+
| :QUEUE_ITEM_REJECTED
|
|
54
|
+
| :QUEUE_ITEM_ALLOWED
|
|
55
|
+
| :AUTHOR_BLOCKED
|
|
56
|
+
| :AUTHOR_UNBLOCKED
|
|
57
|
+
| :AUTHOR_SUSPENDED
|
|
58
|
+
| :AUTHOR_UPDATED
|
|
59
|
+
| :AUTHOR_TRUST_LEVEL_CHANGED
|
|
60
|
+
| :AUTHOR_ACTION
|
|
61
|
+
|
|
62
|
+
module EventType
|
|
63
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
64
|
+
|
|
65
|
+
QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW
|
|
66
|
+
QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED
|
|
67
|
+
QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION
|
|
68
|
+
QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED
|
|
69
|
+
QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED
|
|
70
|
+
AUTHOR_BLOCKED: :AUTHOR_BLOCKED
|
|
71
|
+
AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED
|
|
72
|
+
AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED
|
|
73
|
+
AUTHOR_UPDATED: :AUTHOR_UPDATED
|
|
74
|
+
AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED
|
|
75
|
+
AUTHOR_ACTION: :AUTHOR_ACTION
|
|
76
|
+
|
|
77
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
type payload_version = :V1 | :V2
|
|
81
|
+
|
|
82
|
+
module PayloadVersion
|
|
83
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
84
|
+
|
|
85
|
+
V1: :V1
|
|
86
|
+
V2: :V2
|
|
87
|
+
|
|
88
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookListResponseItem::payload_version]
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
type webhook_list_response =
|
|
93
|
+
::Array[ModerationAPI::Models::WebhookListResponseItem]
|
|
94
|
+
|
|
95
|
+
WebhookListResponse: ModerationAPI::Internal::Type::Converter
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_retrieve_params =
|
|
4
|
+
{ id: String } & ModerationAPI::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class WebhookRetrieveParams < ModerationAPI::Internal::Type::BaseModel
|
|
7
|
+
extend ModerationAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include ModerationAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
attr_accessor id: String
|
|
11
|
+
|
|
12
|
+
def initialize: (
|
|
13
|
+
id: String,
|
|
14
|
+
?request_options: ModerationAPI::request_opts
|
|
15
|
+
) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> {
|
|
18
|
+
id: String,
|
|
19
|
+
request_options: ModerationAPI::RequestOptions
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_retrieve_response =
|
|
4
|
+
{
|
|
5
|
+
id: String,
|
|
6
|
+
created_at: String,
|
|
7
|
+
event_types: ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type],
|
|
8
|
+
name: String,
|
|
9
|
+
payload_version: ModerationAPI::Models::WebhookRetrieveResponse::payload_version,
|
|
10
|
+
url: String,
|
|
11
|
+
description: String?
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class WebhookRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
|
|
15
|
+
attr_accessor id: String
|
|
16
|
+
|
|
17
|
+
attr_accessor created_at: String
|
|
18
|
+
|
|
19
|
+
attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type]
|
|
20
|
+
|
|
21
|
+
attr_accessor name: String
|
|
22
|
+
|
|
23
|
+
attr_accessor payload_version: ModerationAPI::Models::WebhookRetrieveResponse::payload_version
|
|
24
|
+
|
|
25
|
+
attr_accessor url: String
|
|
26
|
+
|
|
27
|
+
attr_accessor description: String?
|
|
28
|
+
|
|
29
|
+
def initialize: (
|
|
30
|
+
id: String,
|
|
31
|
+
created_at: String,
|
|
32
|
+
event_types: ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type],
|
|
33
|
+
name: String,
|
|
34
|
+
payload_version: ModerationAPI::Models::WebhookRetrieveResponse::payload_version,
|
|
35
|
+
url: String,
|
|
36
|
+
?description: String?
|
|
37
|
+
) -> void
|
|
38
|
+
|
|
39
|
+
def to_hash: -> {
|
|
40
|
+
id: String,
|
|
41
|
+
created_at: String,
|
|
42
|
+
event_types: ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type],
|
|
43
|
+
name: String,
|
|
44
|
+
payload_version: ModerationAPI::Models::WebhookRetrieveResponse::payload_version,
|
|
45
|
+
url: String,
|
|
46
|
+
description: String?
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type event_type =
|
|
50
|
+
:QUEUE_ITEM_NEW
|
|
51
|
+
| :QUEUE_ITEM_COMPLETED
|
|
52
|
+
| :QUEUE_ITEM_ACTION
|
|
53
|
+
| :QUEUE_ITEM_REJECTED
|
|
54
|
+
| :QUEUE_ITEM_ALLOWED
|
|
55
|
+
| :AUTHOR_BLOCKED
|
|
56
|
+
| :AUTHOR_UNBLOCKED
|
|
57
|
+
| :AUTHOR_SUSPENDED
|
|
58
|
+
| :AUTHOR_UPDATED
|
|
59
|
+
| :AUTHOR_TRUST_LEVEL_CHANGED
|
|
60
|
+
| :AUTHOR_ACTION
|
|
61
|
+
|
|
62
|
+
module EventType
|
|
63
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
64
|
+
|
|
65
|
+
QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW
|
|
66
|
+
QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED
|
|
67
|
+
QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION
|
|
68
|
+
QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED
|
|
69
|
+
QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED
|
|
70
|
+
AUTHOR_BLOCKED: :AUTHOR_BLOCKED
|
|
71
|
+
AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED
|
|
72
|
+
AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED
|
|
73
|
+
AUTHOR_UPDATED: :AUTHOR_UPDATED
|
|
74
|
+
AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED
|
|
75
|
+
AUTHOR_ACTION: :AUTHOR_ACTION
|
|
76
|
+
|
|
77
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
type payload_version = :V1 | :V2
|
|
81
|
+
|
|
82
|
+
module PayloadVersion
|
|
83
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
84
|
+
|
|
85
|
+
V1: :V1
|
|
86
|
+
V2: :V2
|
|
87
|
+
|
|
88
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookRetrieveResponse::payload_version]
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_secret_retrieve_params =
|
|
4
|
+
{ } & ModerationAPI::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class WebhookSecretRetrieveParams < ModerationAPI::Internal::Type::BaseModel
|
|
7
|
+
extend ModerationAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include ModerationAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
def initialize: (?request_options: ModerationAPI::request_opts) -> void
|
|
11
|
+
|
|
12
|
+
def to_hash: -> { request_options: ModerationAPI::RequestOptions }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_secret_retrieve_response = { secret: String }
|
|
4
|
+
|
|
5
|
+
class WebhookSecretRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
|
|
6
|
+
attr_accessor secret: String
|
|
7
|
+
|
|
8
|
+
def initialize: (secret: String) -> void
|
|
9
|
+
|
|
10
|
+
def to_hash: -> { secret: String }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_update_params =
|
|
4
|
+
{
|
|
5
|
+
id: String,
|
|
6
|
+
description: String?,
|
|
7
|
+
event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type],
|
|
8
|
+
name: String,
|
|
9
|
+
url: String
|
|
10
|
+
}
|
|
11
|
+
& ModerationAPI::Internal::Type::request_parameters
|
|
12
|
+
|
|
13
|
+
class WebhookUpdateParams < ModerationAPI::Internal::Type::BaseModel
|
|
14
|
+
extend ModerationAPI::Internal::Type::RequestParameters::Converter
|
|
15
|
+
include ModerationAPI::Internal::Type::RequestParameters
|
|
16
|
+
|
|
17
|
+
attr_accessor id: String
|
|
18
|
+
|
|
19
|
+
attr_accessor description: String?
|
|
20
|
+
|
|
21
|
+
attr_reader event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type]?
|
|
22
|
+
|
|
23
|
+
def event_types=: (
|
|
24
|
+
::Array[ModerationAPI::Models::WebhookUpdateParams::event_type]
|
|
25
|
+
) -> ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type]
|
|
26
|
+
|
|
27
|
+
attr_reader name: String?
|
|
28
|
+
|
|
29
|
+
def name=: (String) -> String
|
|
30
|
+
|
|
31
|
+
attr_reader url: String?
|
|
32
|
+
|
|
33
|
+
def url=: (String) -> String
|
|
34
|
+
|
|
35
|
+
def initialize: (
|
|
36
|
+
id: String,
|
|
37
|
+
?description: String?,
|
|
38
|
+
?event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type],
|
|
39
|
+
?name: String,
|
|
40
|
+
?url: String,
|
|
41
|
+
?request_options: ModerationAPI::request_opts
|
|
42
|
+
) -> void
|
|
43
|
+
|
|
44
|
+
def to_hash: -> {
|
|
45
|
+
id: String,
|
|
46
|
+
description: String?,
|
|
47
|
+
event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type],
|
|
48
|
+
name: String,
|
|
49
|
+
url: String,
|
|
50
|
+
request_options: ModerationAPI::RequestOptions
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type event_type =
|
|
54
|
+
:QUEUE_ITEM_NEW
|
|
55
|
+
| :QUEUE_ITEM_COMPLETED
|
|
56
|
+
| :QUEUE_ITEM_ACTION
|
|
57
|
+
| :QUEUE_ITEM_REJECTED
|
|
58
|
+
| :QUEUE_ITEM_ALLOWED
|
|
59
|
+
| :AUTHOR_BLOCKED
|
|
60
|
+
| :AUTHOR_UNBLOCKED
|
|
61
|
+
| :AUTHOR_SUSPENDED
|
|
62
|
+
| :AUTHOR_UPDATED
|
|
63
|
+
| :AUTHOR_TRUST_LEVEL_CHANGED
|
|
64
|
+
| :AUTHOR_ACTION
|
|
65
|
+
|
|
66
|
+
module EventType
|
|
67
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
68
|
+
|
|
69
|
+
QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW
|
|
70
|
+
QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED
|
|
71
|
+
QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION
|
|
72
|
+
QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED
|
|
73
|
+
QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED
|
|
74
|
+
AUTHOR_BLOCKED: :AUTHOR_BLOCKED
|
|
75
|
+
AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED
|
|
76
|
+
AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED
|
|
77
|
+
AUTHOR_UPDATED: :AUTHOR_UPDATED
|
|
78
|
+
AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED
|
|
79
|
+
AUTHOR_ACTION: :AUTHOR_ACTION
|
|
80
|
+
|
|
81
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type]
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Models
|
|
3
|
+
type webhook_update_response =
|
|
4
|
+
{
|
|
5
|
+
id: String,
|
|
6
|
+
created_at: String,
|
|
7
|
+
event_types: ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type],
|
|
8
|
+
name: String,
|
|
9
|
+
payload_version: ModerationAPI::Models::WebhookUpdateResponse::payload_version,
|
|
10
|
+
url: String,
|
|
11
|
+
description: String?
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class WebhookUpdateResponse < ModerationAPI::Internal::Type::BaseModel
|
|
15
|
+
attr_accessor id: String
|
|
16
|
+
|
|
17
|
+
attr_accessor created_at: String
|
|
18
|
+
|
|
19
|
+
attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type]
|
|
20
|
+
|
|
21
|
+
attr_accessor name: String
|
|
22
|
+
|
|
23
|
+
attr_accessor payload_version: ModerationAPI::Models::WebhookUpdateResponse::payload_version
|
|
24
|
+
|
|
25
|
+
attr_accessor url: String
|
|
26
|
+
|
|
27
|
+
attr_accessor description: String?
|
|
28
|
+
|
|
29
|
+
def initialize: (
|
|
30
|
+
id: String,
|
|
31
|
+
created_at: String,
|
|
32
|
+
event_types: ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type],
|
|
33
|
+
name: String,
|
|
34
|
+
payload_version: ModerationAPI::Models::WebhookUpdateResponse::payload_version,
|
|
35
|
+
url: String,
|
|
36
|
+
?description: String?
|
|
37
|
+
) -> void
|
|
38
|
+
|
|
39
|
+
def to_hash: -> {
|
|
40
|
+
id: String,
|
|
41
|
+
created_at: String,
|
|
42
|
+
event_types: ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type],
|
|
43
|
+
name: String,
|
|
44
|
+
payload_version: ModerationAPI::Models::WebhookUpdateResponse::payload_version,
|
|
45
|
+
url: String,
|
|
46
|
+
description: String?
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
type event_type =
|
|
50
|
+
:QUEUE_ITEM_NEW
|
|
51
|
+
| :QUEUE_ITEM_COMPLETED
|
|
52
|
+
| :QUEUE_ITEM_ACTION
|
|
53
|
+
| :QUEUE_ITEM_REJECTED
|
|
54
|
+
| :QUEUE_ITEM_ALLOWED
|
|
55
|
+
| :AUTHOR_BLOCKED
|
|
56
|
+
| :AUTHOR_UNBLOCKED
|
|
57
|
+
| :AUTHOR_SUSPENDED
|
|
58
|
+
| :AUTHOR_UPDATED
|
|
59
|
+
| :AUTHOR_TRUST_LEVEL_CHANGED
|
|
60
|
+
| :AUTHOR_ACTION
|
|
61
|
+
|
|
62
|
+
module EventType
|
|
63
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
64
|
+
|
|
65
|
+
QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW
|
|
66
|
+
QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED
|
|
67
|
+
QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION
|
|
68
|
+
QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED
|
|
69
|
+
QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED
|
|
70
|
+
AUTHOR_BLOCKED: :AUTHOR_BLOCKED
|
|
71
|
+
AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED
|
|
72
|
+
AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED
|
|
73
|
+
AUTHOR_UPDATED: :AUTHOR_UPDATED
|
|
74
|
+
AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED
|
|
75
|
+
AUTHOR_ACTION: :AUTHOR_ACTION
|
|
76
|
+
|
|
77
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
type payload_version = :V1 | :V2
|
|
81
|
+
|
|
82
|
+
module PayloadVersion
|
|
83
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
84
|
+
|
|
85
|
+
V1: :V1
|
|
86
|
+
V2: :V2
|
|
87
|
+
|
|
88
|
+
def self?.values: -> ::Array[ModerationAPI::Models::WebhookUpdateResponse::payload_version]
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -27,6 +27,8 @@ module ModerationAPI
|
|
|
27
27
|
|
|
28
28
|
class AuthRetrieveParams = ModerationAPI::Models::AuthRetrieveParams
|
|
29
29
|
|
|
30
|
+
class ContentStreamParams = ModerationAPI::Models::ContentStreamParams
|
|
31
|
+
|
|
30
32
|
class ContentSubmitParams = ModerationAPI::Models::ContentSubmitParams
|
|
31
33
|
|
|
32
34
|
module Queue = ModerationAPI::Models::Queue
|
|
@@ -35,8 +37,20 @@ module ModerationAPI
|
|
|
35
37
|
|
|
36
38
|
class QueueRetrieveParams = ModerationAPI::Models::QueueRetrieveParams
|
|
37
39
|
|
|
40
|
+
class WebhookCreateParams = ModerationAPI::Models::WebhookCreateParams
|
|
41
|
+
|
|
42
|
+
class WebhookDeleteParams = ModerationAPI::Models::WebhookDeleteParams
|
|
43
|
+
|
|
38
44
|
module WebhookEvent = ModerationAPI::Models::WebhookEvent
|
|
39
45
|
|
|
46
|
+
class WebhookListParams = ModerationAPI::Models::WebhookListParams
|
|
47
|
+
|
|
48
|
+
class WebhookRetrieveParams = ModerationAPI::Models::WebhookRetrieveParams
|
|
49
|
+
|
|
50
|
+
class WebhookSecretRetrieveParams = ModerationAPI::Models::WebhookSecretRetrieveParams
|
|
51
|
+
|
|
52
|
+
class WebhookUpdateParams = ModerationAPI::Models::WebhookUpdateParams
|
|
53
|
+
|
|
40
54
|
module Wordlist = ModerationAPI::Models::Wordlist
|
|
41
55
|
|
|
42
56
|
class WordlistGetEmbeddingStatusParams = ModerationAPI::Models::WordlistGetEmbeddingStatusParams
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
module ModerationAPI
|
|
2
2
|
module Resources
|
|
3
3
|
class Content
|
|
4
|
+
def stream: (
|
|
5
|
+
sec_web_socket_protocol: ModerationAPI::Models::ContentStreamParams::sec_web_socket_protocol,
|
|
6
|
+
?request_options: ModerationAPI::request_opts
|
|
7
|
+
) -> nil
|
|
8
|
+
|
|
4
9
|
def submit: (
|
|
5
10
|
content: ModerationAPI::Models::ContentSubmitParams::content,
|
|
6
11
|
?author_id: String,
|