moderation_api 3.0.0 → 3.1.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/lib/moderation_api/account.rb +10 -4
- data/lib/moderation_api/actions.rb +39 -20
- data/lib/moderation_api/authors.rb +27 -15
- data/lib/moderation_api/content.rb +10 -5
- data/lib/moderation_api/items.rb +13 -8
- data/lib/moderation_api/models/components/badrequesterror_code.rb +2 -0
- data/lib/moderation_api/models/components/permissiondeniederror_code.rb +0 -2
- data/lib/moderation_api/models/errors/badrequesterror.rb +1 -0
- data/lib/moderation_api/models/errors/permissiondeniederror.rb +0 -1
- data/lib/moderation_api/models/operations/addwordlistwords_request.rb +13 -2
- data/lib/moderation_api/models/operations/addwordlistwords_request.rbi +6 -0
- data/lib/moderation_api/models/operations/createaction_request.rb +10 -132
- data/lib/moderation_api/models/operations/createaction_request.rbi +4 -58
- data/lib/moderation_api/models/operations/createaction_requestbody.rb +160 -0
- data/lib/moderation_api/models/operations/createaction_requestbody.rbi +74 -0
- data/lib/moderation_api/models/operations/createauthor_request.rb +10 -104
- data/lib/moderation_api/models/operations/createauthor_request.rbi +4 -52
- data/lib/moderation_api/models/operations/createauthor_requestbody.rb +132 -0
- data/lib/moderation_api/models/operations/createauthor_requestbody.rbi +68 -0
- data/lib/moderation_api/models/operations/createwebhook_request.rb +10 -35
- data/lib/moderation_api/models/operations/createwebhook_request.rbi +4 -16
- data/lib/moderation_api/models/operations/createwebhook_requestbody.rb +63 -0
- data/lib/moderation_api/models/operations/createwebhook_requestbody.rbi +32 -0
- data/lib/moderation_api/models/operations/deleteaction_request.rb +10 -2
- data/lib/moderation_api/models/operations/deleteaction_request.rbi +6 -0
- data/lib/moderation_api/models/operations/deleteauthor_request.rb +10 -2
- data/lib/moderation_api/models/operations/deleteauthor_request.rbi +6 -0
- data/lib/moderation_api/models/operations/deletewebhook_request.rb +10 -2
- data/lib/moderation_api/models/operations/deletewebhook_request.rbi +6 -0
- data/lib/moderation_api/models/operations/executeaction_request.rb +11 -58
- data/lib/moderation_api/models/operations/executeaction_request.rbi +4 -28
- data/lib/moderation_api/models/operations/executeaction_requestbody.rb +85 -0
- data/lib/moderation_api/models/operations/executeaction_requestbody.rbi +44 -0
- data/lib/moderation_api/models/operations/getaccount_request.rb +35 -0
- data/lib/moderation_api/models/operations/getaccount_request.rbi +14 -0
- data/lib/moderation_api/models/operations/getaction_request.rb +10 -2
- data/lib/moderation_api/models/operations/getaction_request.rbi +6 -0
- data/lib/moderation_api/models/operations/getauthor_request.rb +10 -2
- data/lib/moderation_api/models/operations/getauthor_request.rbi +6 -0
- data/lib/moderation_api/models/operations/getqueue_request.rb +10 -2
- data/lib/moderation_api/models/operations/getqueue_request.rbi +6 -0
- data/lib/moderation_api/models/operations/getqueuestats_request.rb +10 -2
- data/lib/moderation_api/models/operations/getqueuestats_request.rbi +6 -0
- data/lib/moderation_api/models/operations/getwebhook_request.rb +10 -2
- data/lib/moderation_api/models/operations/getwebhook_request.rbi +6 -0
- data/lib/moderation_api/models/operations/getwebhooksecret_request.rb +35 -0
- data/lib/moderation_api/models/operations/getwebhooksecret_request.rbi +14 -0
- data/lib/moderation_api/models/operations/getwordlist_request.rb +10 -2
- data/lib/moderation_api/models/operations/getwordlist_request.rbi +6 -0
- data/lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rb +10 -2
- data/lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rbi +6 -0
- data/lib/moderation_api/models/operations/listactions_request.rb +18 -2
- data/lib/moderation_api/models/operations/listactions_request.rbi +6 -0
- data/lib/moderation_api/models/operations/listauthors_request.rb +10 -0
- data/lib/moderation_api/models/operations/listauthors_request.rbi +6 -0
- data/lib/moderation_api/models/operations/listqueueitems_request.rb +10 -0
- data/lib/moderation_api/models/operations/listqueueitems_request.rbi +6 -0
- data/lib/moderation_api/models/operations/listwebhooks_request.rb +13 -2
- data/lib/moderation_api/models/operations/listwebhooks_request.rbi +6 -0
- data/lib/moderation_api/models/operations/listwordlists_request.rb +13 -2
- data/lib/moderation_api/models/operations/listwordlists_request.rbi +6 -0
- data/lib/moderation_api/models/operations/removewordlistwords_request.rb +10 -2
- data/lib/moderation_api/models/operations/removewordlistwords_request.rbi +6 -0
- data/lib/moderation_api/models/operations/resolvequeueitem_request.rb +18 -2
- data/lib/moderation_api/models/operations/resolvequeueitem_request.rbi +6 -0
- data/lib/moderation_api/models/operations/submitcontent_request.rb +10 -231
- data/lib/moderation_api/models/operations/submitcontent_request.rbi +4 -58
- data/lib/moderation_api/models/operations/submitcontent_requestbody.rb +259 -0
- data/lib/moderation_api/models/operations/submitcontent_requestbody.rbi +74 -0
- data/lib/moderation_api/models/operations/unresolvequeueitem_request.rb +18 -2
- data/lib/moderation_api/models/operations/unresolvequeueitem_request.rbi +6 -0
- data/lib/moderation_api/models/operations/updateaction_request.rb +12 -2
- data/lib/moderation_api/models/operations/updateaction_request.rbi +6 -0
- data/lib/moderation_api/models/operations/updateauthor_request.rb +12 -2
- data/lib/moderation_api/models/operations/updateauthor_request.rbi +6 -0
- data/lib/moderation_api/models/operations/updatewebhook_request.rb +12 -2
- data/lib/moderation_api/models/operations/updatewebhook_request.rbi +6 -0
- data/lib/moderation_api/models/operations/updatewordlist_request.rb +13 -2
- data/lib/moderation_api/models/operations/updatewordlist_request.rbi +6 -0
- data/lib/moderation_api/models/operations.rb +7 -0
- data/lib/moderation_api/queue.rb +10 -6
- data/lib/moderation_api/sdkconfiguration.rb +2 -2
- data/lib/moderation_api/webhooks.rb +30 -16
- data/lib/moderation_api/webhooksecret.rb +10 -4
- data/lib/moderation_api/wordlist.rb +21 -12
- data/lib/moderation_api/words.rb +10 -6
- metadata +15 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aaa3bf539924afb59ca86f8f756d5df9f50b40ca23ec224e1bc2b52d6fe2481f
|
|
4
|
+
data.tar.gz: 7731365f6729d2f959bab7cf3ce8989cd77cdf41e25e365573e8940f744bcab6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 942ed147a1bdfdec97e63ec92bdd93172c659dd8022c6ee3bbd507f2fc2ec3086c14623631078017d2bafac91c317f25bf1b058926b9d1b93bdcc38b4ef20baa
|
|
7
|
+
data.tar.gz: ea1086113b098ef4089bebae4612ceaff17623d84a33b39f07b1cda2cd92557c222f3bb4dd6b4c745f5207719fff90929ccdc219d1706a6097c213bd1d5a3cc3
|
|
@@ -38,17 +38,23 @@ module ModerationApi
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
sig {
|
|
41
|
-
params(
|
|
42
|
-
|
|
41
|
+
params(
|
|
42
|
+
project_id: T.nilable(::String),
|
|
43
|
+
timeout_ms: T.nilable(Integer),
|
|
44
|
+
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
43
45
|
)
|
|
46
|
+
.returns(Models::Operations::GetAccountResponse)
|
|
44
47
|
}
|
|
45
|
-
def retrieve(timeout_ms: nil, http_headers: nil)
|
|
48
|
+
def retrieve(project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
46
49
|
# retrieve - Get account details
|
|
47
50
|
# Get account details
|
|
51
|
+
request = Models::Operations::GetAccountRequest.new(
|
|
52
|
+
project_id: project_id
|
|
53
|
+
)
|
|
48
54
|
url, params = @sdk_configuration.get_server_details
|
|
49
55
|
base_url = Utils.template_url(url, params)
|
|
50
56
|
url = "#{base_url}/account"
|
|
51
|
-
headers =
|
|
57
|
+
headers = Utils.get_headers(request)
|
|
52
58
|
headers = T.cast(headers, T::Hash[String, String])
|
|
53
59
|
headers["Accept"] = "application/json"
|
|
54
60
|
headers["user-agent"] = @sdk_configuration.user_agent
|
|
@@ -43,23 +43,25 @@ module ModerationApi
|
|
|
43
43
|
queue_id: T.nilable(::String),
|
|
44
44
|
page: T.nilable(::Integer),
|
|
45
45
|
page_size: T.nilable(::Integer),
|
|
46
|
+
project_id: T.nilable(::String),
|
|
46
47
|
timeout_ms: T.nilable(Integer),
|
|
47
48
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
48
49
|
)
|
|
49
50
|
.returns(Models::Operations::ListActionsResponse)
|
|
50
51
|
}
|
|
51
|
-
def list(queue_id: nil, page: nil, page_size: nil, timeout_ms: nil, http_headers: nil)
|
|
52
|
+
def list(queue_id: nil, page: nil, page_size: nil, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
52
53
|
# list - List moderation actions
|
|
53
54
|
# List the moderation actions of the project. The list is paginated.
|
|
54
55
|
request = Models::Operations::ListActionsRequest.new(
|
|
55
56
|
queue_id: queue_id,
|
|
56
57
|
page: page,
|
|
57
|
-
page_size: page_size
|
|
58
|
+
page_size: page_size,
|
|
59
|
+
project_id: project_id
|
|
58
60
|
)
|
|
59
61
|
url, params = @sdk_configuration.get_server_details
|
|
60
62
|
base_url = Utils.template_url(url, params)
|
|
61
63
|
url = "#{base_url}/actions"
|
|
62
|
-
headers =
|
|
64
|
+
headers = Utils.get_headers(request)
|
|
63
65
|
headers = T.cast(headers, T::Hash[String, String])
|
|
64
66
|
query_params = Utils.get_query_params(Models::Operations::ListActionsRequest, request, nil)
|
|
65
67
|
headers["Accept"] = "application/json"
|
|
@@ -176,6 +178,7 @@ module ModerationApi
|
|
|
176
178
|
queue_id: request.queue_id,
|
|
177
179
|
page: next_page,
|
|
178
180
|
page_size: request.page_size,
|
|
181
|
+
project_id: request.project_id,
|
|
179
182
|
http_headers: http_headers
|
|
180
183
|
)
|
|
181
184
|
end
|
|
@@ -356,21 +359,26 @@ module ModerationApi
|
|
|
356
359
|
|
|
357
360
|
sig {
|
|
358
361
|
params(
|
|
359
|
-
|
|
362
|
+
body: Models::Operations::CreateActionRequestBody,
|
|
363
|
+
project_id: T.nilable(::String),
|
|
360
364
|
timeout_ms: T.nilable(Integer),
|
|
361
365
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
362
366
|
)
|
|
363
367
|
.returns(Models::Operations::CreateActionResponse)
|
|
364
368
|
}
|
|
365
|
-
def create(
|
|
369
|
+
def create(body:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
366
370
|
# create - Create an action
|
|
367
371
|
# Create an action.
|
|
372
|
+
request = Models::Operations::CreateActionRequest.new(
|
|
373
|
+
body: body,
|
|
374
|
+
project_id: project_id
|
|
375
|
+
)
|
|
368
376
|
url, params = @sdk_configuration.get_server_details
|
|
369
377
|
base_url = Utils.template_url(url, params)
|
|
370
378
|
url = "#{base_url}/actions"
|
|
371
|
-
headers =
|
|
379
|
+
headers = Utils.get_headers(request)
|
|
372
380
|
headers = T.cast(headers, T::Hash[String, String])
|
|
373
|
-
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :
|
|
381
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
374
382
|
headers["content-type"] = req_content_type
|
|
375
383
|
raise StandardError, "request body is required" if data.nil? && form.nil?
|
|
376
384
|
|
|
@@ -598,16 +606,18 @@ module ModerationApi
|
|
|
598
606
|
sig {
|
|
599
607
|
params(
|
|
600
608
|
id: ::String,
|
|
609
|
+
project_id: T.nilable(::String),
|
|
601
610
|
timeout_ms: T.nilable(Integer),
|
|
602
611
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
603
612
|
)
|
|
604
613
|
.returns(Models::Operations::GetActionResponse)
|
|
605
614
|
}
|
|
606
|
-
def retrieve(id:, timeout_ms: nil, http_headers: nil)
|
|
615
|
+
def retrieve(id:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
607
616
|
# retrieve - Get an action
|
|
608
617
|
# Get an action by ID.
|
|
609
618
|
request = Models::Operations::GetActionRequest.new(
|
|
610
|
-
id: id
|
|
619
|
+
id: id,
|
|
620
|
+
project_id: project_id
|
|
611
621
|
)
|
|
612
622
|
url, params = @sdk_configuration.get_server_details
|
|
613
623
|
base_url = Utils.template_url(url, params)
|
|
@@ -617,7 +627,7 @@ module ModerationApi
|
|
|
617
627
|
"/actions/{id}",
|
|
618
628
|
request
|
|
619
629
|
)
|
|
620
|
-
headers =
|
|
630
|
+
headers = Utils.get_headers(request)
|
|
621
631
|
headers = T.cast(headers, T::Hash[String, String])
|
|
622
632
|
headers["Accept"] = "application/json"
|
|
623
633
|
headers["user-agent"] = @sdk_configuration.user_agent
|
|
@@ -835,17 +845,19 @@ module ModerationApi
|
|
|
835
845
|
params(
|
|
836
846
|
body: Models::Operations::UpdateActionRequestBody,
|
|
837
847
|
id: ::String,
|
|
848
|
+
project_id: T.nilable(::String),
|
|
838
849
|
timeout_ms: T.nilable(Integer),
|
|
839
850
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
840
851
|
)
|
|
841
852
|
.returns(Models::Operations::UpdateActionResponse)
|
|
842
853
|
}
|
|
843
|
-
def update(body:, id:, timeout_ms: nil, http_headers: nil)
|
|
854
|
+
def update(body:, id:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
844
855
|
# update - Update an action
|
|
845
856
|
# Update an action.
|
|
846
857
|
request = Models::Operations::UpdateActionRequest.new(
|
|
847
858
|
id: id,
|
|
848
|
-
body: body
|
|
859
|
+
body: body,
|
|
860
|
+
project_id: project_id
|
|
849
861
|
)
|
|
850
862
|
url, params = @sdk_configuration.get_server_details
|
|
851
863
|
base_url = Utils.template_url(url, params)
|
|
@@ -855,7 +867,7 @@ module ModerationApi
|
|
|
855
867
|
"/actions/{id}",
|
|
856
868
|
request
|
|
857
869
|
)
|
|
858
|
-
headers =
|
|
870
|
+
headers = Utils.get_headers(request)
|
|
859
871
|
headers = T.cast(headers, T::Hash[String, String])
|
|
860
872
|
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
861
873
|
headers["content-type"] = req_content_type
|
|
@@ -1107,16 +1119,18 @@ module ModerationApi
|
|
|
1107
1119
|
sig {
|
|
1108
1120
|
params(
|
|
1109
1121
|
id: ::String,
|
|
1122
|
+
project_id: T.nilable(::String),
|
|
1110
1123
|
timeout_ms: T.nilable(Integer),
|
|
1111
1124
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
1112
1125
|
)
|
|
1113
1126
|
.returns(Models::Operations::DeleteActionResponse)
|
|
1114
1127
|
}
|
|
1115
|
-
def delete(id:, timeout_ms: nil, http_headers: nil)
|
|
1128
|
+
def delete(id:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
1116
1129
|
# delete - Delete an action
|
|
1117
1130
|
# Delete an action and all of its webhooks.
|
|
1118
1131
|
request = Models::Operations::DeleteActionRequest.new(
|
|
1119
|
-
id: id
|
|
1132
|
+
id: id,
|
|
1133
|
+
project_id: project_id
|
|
1120
1134
|
)
|
|
1121
1135
|
url, params = @sdk_configuration.get_server_details
|
|
1122
1136
|
base_url = Utils.template_url(url, params)
|
|
@@ -1126,7 +1140,7 @@ module ModerationApi
|
|
|
1126
1140
|
"/actions/{id}",
|
|
1127
1141
|
request
|
|
1128
1142
|
)
|
|
1129
|
-
headers =
|
|
1143
|
+
headers = Utils.get_headers(request)
|
|
1130
1144
|
headers = T.cast(headers, T::Hash[String, String])
|
|
1131
1145
|
headers["Accept"] = "application/json"
|
|
1132
1146
|
headers["user-agent"] = @sdk_configuration.user_agent
|
|
@@ -1342,21 +1356,26 @@ module ModerationApi
|
|
|
1342
1356
|
|
|
1343
1357
|
sig {
|
|
1344
1358
|
params(
|
|
1345
|
-
|
|
1359
|
+
body: Models::Operations::ExecuteActionRequestBody,
|
|
1360
|
+
project_id: T.nilable(::String),
|
|
1346
1361
|
timeout_ms: T.nilable(Integer),
|
|
1347
1362
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
1348
1363
|
)
|
|
1349
1364
|
.returns(Models::Operations::ExecuteActionResponse)
|
|
1350
1365
|
}
|
|
1351
|
-
def execute(
|
|
1366
|
+
def execute(body:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
1352
1367
|
# execute - Execute moderation action
|
|
1353
1368
|
# Execute a moderation action on one or more content items.
|
|
1369
|
+
request = Models::Operations::ExecuteActionRequest.new(
|
|
1370
|
+
body: body,
|
|
1371
|
+
project_id: project_id
|
|
1372
|
+
)
|
|
1354
1373
|
url, params = @sdk_configuration.get_server_details
|
|
1355
1374
|
base_url = Utils.template_url(url, params)
|
|
1356
1375
|
url = "#{base_url}/actions/execute"
|
|
1357
|
-
headers =
|
|
1376
|
+
headers = Utils.get_headers(request)
|
|
1358
1377
|
headers = T.cast(headers, T::Hash[String, String])
|
|
1359
|
-
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :
|
|
1378
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
1360
1379
|
headers["content-type"] = req_content_type
|
|
1361
1380
|
raise StandardError, "request body is required" if data.nil? && form.nil?
|
|
1362
1381
|
|
|
@@ -52,7 +52,7 @@ module ModerationApi
|
|
|
52
52
|
url, params = @sdk_configuration.get_server_details
|
|
53
53
|
base_url = Utils.template_url(url, params)
|
|
54
54
|
url = "#{base_url}/authors"
|
|
55
|
-
headers =
|
|
55
|
+
headers = Utils.get_headers(request)
|
|
56
56
|
headers = T.cast(headers, T::Hash[String, String])
|
|
57
57
|
query_params = Utils.get_query_params(Models::Operations::ListAuthorsRequest, request, nil)
|
|
58
58
|
headers["Accept"] = "application/json"
|
|
@@ -173,7 +173,8 @@ module ModerationApi
|
|
|
173
173
|
sort_direction: request.sort_direction,
|
|
174
174
|
member_since_date: request.member_since_date,
|
|
175
175
|
last_active_date: request.last_active_date,
|
|
176
|
-
content_types: request.content_types
|
|
176
|
+
content_types: request.content_types,
|
|
177
|
+
project_id: request.project_id
|
|
177
178
|
),
|
|
178
179
|
http_headers: http_headers
|
|
179
180
|
)
|
|
@@ -355,21 +356,26 @@ module ModerationApi
|
|
|
355
356
|
|
|
356
357
|
sig {
|
|
357
358
|
params(
|
|
358
|
-
|
|
359
|
+
body: Models::Operations::CreateAuthorRequestBody,
|
|
360
|
+
project_id: T.nilable(::String),
|
|
359
361
|
timeout_ms: T.nilable(Integer),
|
|
360
362
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
361
363
|
)
|
|
362
364
|
.returns(Models::Operations::CreateAuthorResponse)
|
|
363
365
|
}
|
|
364
|
-
def create(
|
|
366
|
+
def create(body:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
365
367
|
# create - Create a new author
|
|
366
368
|
# Create a new author. Typically not needed as authors are created automatically when content is moderated.
|
|
369
|
+
request = Models::Operations::CreateAuthorRequest.new(
|
|
370
|
+
body: body,
|
|
371
|
+
project_id: project_id
|
|
372
|
+
)
|
|
367
373
|
url, params = @sdk_configuration.get_server_details
|
|
368
374
|
base_url = Utils.template_url(url, params)
|
|
369
375
|
url = "#{base_url}/authors"
|
|
370
|
-
headers =
|
|
376
|
+
headers = Utils.get_headers(request)
|
|
371
377
|
headers = T.cast(headers, T::Hash[String, String])
|
|
372
|
-
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :
|
|
378
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
373
379
|
headers["content-type"] = req_content_type
|
|
374
380
|
raise StandardError, "request body is required" if data.nil? && form.nil?
|
|
375
381
|
|
|
@@ -619,16 +625,18 @@ module ModerationApi
|
|
|
619
625
|
sig {
|
|
620
626
|
params(
|
|
621
627
|
id: ::String,
|
|
628
|
+
project_id: T.nilable(::String),
|
|
622
629
|
timeout_ms: T.nilable(Integer),
|
|
623
630
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
624
631
|
)
|
|
625
632
|
.returns(Models::Operations::GetAuthorResponse)
|
|
626
633
|
}
|
|
627
|
-
def retrieve(id:, timeout_ms: nil, http_headers: nil)
|
|
634
|
+
def retrieve(id:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
628
635
|
# retrieve - Get author details
|
|
629
636
|
# Get detailed information about a specific author including historical data and analysis
|
|
630
637
|
request = Models::Operations::GetAuthorRequest.new(
|
|
631
|
-
id: id
|
|
638
|
+
id: id,
|
|
639
|
+
project_id: project_id
|
|
632
640
|
)
|
|
633
641
|
url, params = @sdk_configuration.get_server_details
|
|
634
642
|
base_url = Utils.template_url(url, params)
|
|
@@ -638,7 +646,7 @@ module ModerationApi
|
|
|
638
646
|
"/authors/{id}",
|
|
639
647
|
request
|
|
640
648
|
)
|
|
641
|
-
headers =
|
|
649
|
+
headers = Utils.get_headers(request)
|
|
642
650
|
headers = T.cast(headers, T::Hash[String, String])
|
|
643
651
|
headers["Accept"] = "application/json"
|
|
644
652
|
headers["user-agent"] = @sdk_configuration.user_agent
|
|
@@ -900,17 +908,19 @@ module ModerationApi
|
|
|
900
908
|
params(
|
|
901
909
|
body: Models::Operations::UpdateAuthorRequestBody,
|
|
902
910
|
id: ::String,
|
|
911
|
+
project_id: T.nilable(::String),
|
|
903
912
|
timeout_ms: T.nilable(Integer),
|
|
904
913
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
905
914
|
)
|
|
906
915
|
.returns(Models::Operations::UpdateAuthorResponse)
|
|
907
916
|
}
|
|
908
|
-
def update(body:, id:, timeout_ms: nil, http_headers: nil)
|
|
917
|
+
def update(body:, id:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
909
918
|
# update - Update author details
|
|
910
919
|
# Update the details of a specific author
|
|
911
920
|
request = Models::Operations::UpdateAuthorRequest.new(
|
|
912
921
|
id: id,
|
|
913
|
-
body: body
|
|
922
|
+
body: body,
|
|
923
|
+
project_id: project_id
|
|
914
924
|
)
|
|
915
925
|
url, params = @sdk_configuration.get_server_details
|
|
916
926
|
base_url = Utils.template_url(url, params)
|
|
@@ -920,7 +930,7 @@ module ModerationApi
|
|
|
920
930
|
"/authors/{id}",
|
|
921
931
|
request
|
|
922
932
|
)
|
|
923
|
-
headers =
|
|
933
|
+
headers = Utils.get_headers(request)
|
|
924
934
|
headers = T.cast(headers, T::Hash[String, String])
|
|
925
935
|
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
926
936
|
headers["content-type"] = req_content_type
|
|
@@ -1194,16 +1204,18 @@ module ModerationApi
|
|
|
1194
1204
|
sig {
|
|
1195
1205
|
params(
|
|
1196
1206
|
id: ::String,
|
|
1207
|
+
project_id: T.nilable(::String),
|
|
1197
1208
|
timeout_ms: T.nilable(Integer),
|
|
1198
1209
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
1199
1210
|
)
|
|
1200
1211
|
.returns(Models::Operations::DeleteAuthorResponse)
|
|
1201
1212
|
}
|
|
1202
|
-
def delete(id:, timeout_ms: nil, http_headers: nil)
|
|
1213
|
+
def delete(id:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
1203
1214
|
# delete - Delete an author
|
|
1204
1215
|
# Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID.
|
|
1205
1216
|
request = Models::Operations::DeleteAuthorRequest.new(
|
|
1206
|
-
id: id
|
|
1217
|
+
id: id,
|
|
1218
|
+
project_id: project_id
|
|
1207
1219
|
)
|
|
1208
1220
|
url, params = @sdk_configuration.get_server_details
|
|
1209
1221
|
base_url = Utils.template_url(url, params)
|
|
@@ -1213,7 +1225,7 @@ module ModerationApi
|
|
|
1213
1225
|
"/authors/{id}",
|
|
1214
1226
|
request
|
|
1215
1227
|
)
|
|
1216
|
-
headers =
|
|
1228
|
+
headers = Utils.get_headers(request)
|
|
1217
1229
|
headers = T.cast(headers, T::Hash[String, String])
|
|
1218
1230
|
headers["Accept"] = "application/json"
|
|
1219
1231
|
headers["user-agent"] = @sdk_configuration.user_agent
|
|
@@ -39,20 +39,25 @@ module ModerationApi
|
|
|
39
39
|
|
|
40
40
|
sig {
|
|
41
41
|
params(
|
|
42
|
-
|
|
42
|
+
body: Models::Operations::SubmitContentRequestBody,
|
|
43
|
+
project_id: T.nilable(::String),
|
|
43
44
|
timeout_ms: T.nilable(Integer),
|
|
44
45
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
45
46
|
)
|
|
46
47
|
.returns(Models::Operations::SubmitContentResponse)
|
|
47
48
|
}
|
|
48
|
-
def submit(
|
|
49
|
-
|
|
49
|
+
def submit(body:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
50
|
+
# submit - Submit content
|
|
51
|
+
request = Models::Operations::SubmitContentRequest.new(
|
|
52
|
+
body: body,
|
|
53
|
+
project_id: project_id
|
|
54
|
+
)
|
|
50
55
|
url, params = @sdk_configuration.get_server_details
|
|
51
56
|
base_url = Utils.template_url(url, params)
|
|
52
57
|
url = "#{base_url}/moderate"
|
|
53
|
-
headers =
|
|
58
|
+
headers = Utils.get_headers(request)
|
|
54
59
|
headers = T.cast(headers, T::Hash[String, String])
|
|
55
|
-
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :
|
|
60
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
56
61
|
headers["content-type"] = req_content_type
|
|
57
62
|
raise StandardError, "request body is required" if data.nil? && form.nil?
|
|
58
63
|
|
data/lib/moderation_api/items.rb
CHANGED
|
@@ -57,7 +57,7 @@ module ModerationApi
|
|
|
57
57
|
"/queue/{id}/items",
|
|
58
58
|
request
|
|
59
59
|
)
|
|
60
|
-
headers =
|
|
60
|
+
headers = Utils.get_headers(request)
|
|
61
61
|
headers = T.cast(headers, T::Hash[String, String])
|
|
62
62
|
query_params = Utils.get_query_params(Models::Operations::ListQueueItemsRequest, request, nil)
|
|
63
63
|
headers["Accept"] = "application/json"
|
|
@@ -183,7 +183,8 @@ module ModerationApi
|
|
|
183
183
|
before_date: request.before_date,
|
|
184
184
|
include_resolved: request.include_resolved,
|
|
185
185
|
author_id: request.author_id,
|
|
186
|
-
filtered_action_ids: request.filtered_action_ids
|
|
186
|
+
filtered_action_ids: request.filtered_action_ids,
|
|
187
|
+
project_id: request.project_id
|
|
187
188
|
),
|
|
188
189
|
http_headers: http_headers
|
|
189
190
|
)
|
|
@@ -368,18 +369,20 @@ module ModerationApi
|
|
|
368
369
|
body: Models::Operations::ResolveQueueItemRequestBody,
|
|
369
370
|
id: ::String,
|
|
370
371
|
item_id: ::String,
|
|
372
|
+
project_id: T.nilable(::String),
|
|
371
373
|
timeout_ms: T.nilable(Integer),
|
|
372
374
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
373
375
|
)
|
|
374
376
|
.returns(Models::Operations::ResolveQueueItemResponse)
|
|
375
377
|
}
|
|
376
|
-
def resolve(body:, id:, item_id:, timeout_ms: nil, http_headers: nil)
|
|
378
|
+
def resolve(body:, id:, item_id:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
377
379
|
# resolve - Resolve a queue item
|
|
378
380
|
# Mark a queue item as resolved with a specific moderation action
|
|
379
381
|
request = Models::Operations::ResolveQueueItemRequest.new(
|
|
380
382
|
id: id,
|
|
381
383
|
item_id: item_id,
|
|
382
|
-
body: body
|
|
384
|
+
body: body,
|
|
385
|
+
project_id: project_id
|
|
383
386
|
)
|
|
384
387
|
url, params = @sdk_configuration.get_server_details
|
|
385
388
|
base_url = Utils.template_url(url, params)
|
|
@@ -389,7 +392,7 @@ module ModerationApi
|
|
|
389
392
|
"/queue/{id}/items/{itemId}/resolve",
|
|
390
393
|
request
|
|
391
394
|
)
|
|
392
|
-
headers =
|
|
395
|
+
headers = Utils.get_headers(request)
|
|
393
396
|
headers = T.cast(headers, T::Hash[String, String])
|
|
394
397
|
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
395
398
|
headers["content-type"] = req_content_type
|
|
@@ -643,18 +646,20 @@ module ModerationApi
|
|
|
643
646
|
body: Models::Operations::UnresolveQueueItemRequestBody,
|
|
644
647
|
id: ::String,
|
|
645
648
|
item_id: ::String,
|
|
649
|
+
project_id: T.nilable(::String),
|
|
646
650
|
timeout_ms: T.nilable(Integer),
|
|
647
651
|
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
648
652
|
)
|
|
649
653
|
.returns(Models::Operations::UnresolveQueueItemResponse)
|
|
650
654
|
}
|
|
651
|
-
def unresolve(body:, id:, item_id:, timeout_ms: nil, http_headers: nil)
|
|
655
|
+
def unresolve(body:, id:, item_id:, project_id: nil, timeout_ms: nil, http_headers: nil)
|
|
652
656
|
# unresolve - Unresolve a queue item
|
|
653
657
|
# Mark a previously resolved queue item as unresolved/pending
|
|
654
658
|
request = Models::Operations::UnresolveQueueItemRequest.new(
|
|
655
659
|
id: id,
|
|
656
660
|
item_id: item_id,
|
|
657
|
-
body: body
|
|
661
|
+
body: body,
|
|
662
|
+
project_id: project_id
|
|
658
663
|
)
|
|
659
664
|
url, params = @sdk_configuration.get_server_details
|
|
660
665
|
base_url = Utils.template_url(url, params)
|
|
@@ -664,7 +669,7 @@ module ModerationApi
|
|
|
664
669
|
"/queue/{id}/items/{itemId}/unresolve",
|
|
665
670
|
request
|
|
666
671
|
)
|
|
667
|
-
headers =
|
|
672
|
+
headers = Utils.get_headers(request)
|
|
668
673
|
headers = T.cast(headers, T::Hash[String, String])
|
|
669
674
|
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json)
|
|
670
675
|
headers["content-type"] = req_content_type
|
|
@@ -9,11 +9,13 @@ module ModerationApi
|
|
|
9
9
|
# BadRequestErrorCode - Exactly what went wrong. Stable; safe to branch on. New codes may be added.
|
|
10
10
|
#
|
|
11
11
|
# - `invalid_request`: A parameter is invalid. `message` says which one.
|
|
12
|
+
# - `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the organization has more than one project.
|
|
12
13
|
# - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`.
|
|
13
14
|
class BadRequestErrorCode
|
|
14
15
|
include ::Crystalline::Enum
|
|
15
16
|
enums do
|
|
16
17
|
INVALID_REQUEST = new("invalid_request")
|
|
18
|
+
PROJECT_ID_REQUIRED = new("project_id_required")
|
|
17
19
|
VALIDATION_FAILED = new("validation_failed")
|
|
18
20
|
end
|
|
19
21
|
|
|
@@ -13,7 +13,6 @@ module ModerationApi
|
|
|
13
13
|
# - `quota_exceeded`: The organization has used all API requests on its plan.
|
|
14
14
|
# - `plan_feature_unavailable`: The current plan does not include this feature.
|
|
15
15
|
# - `plan_limit_exceeded`: The request goes over a limit of the current plan.
|
|
16
|
-
# - `project_key_required`: This endpoint needs a project API key, but an organization key was used.
|
|
17
16
|
# - `organization_key_required`: This endpoint needs an organization API key, but a project key was used.
|
|
18
17
|
# - `missing_key_permission`: The organization key does not have the permission this endpoint needs.
|
|
19
18
|
# - `project_not_reachable`: The organization key is limited to other projects.
|
|
@@ -25,7 +24,6 @@ module ModerationApi
|
|
|
25
24
|
QUOTA_EXCEEDED = new("quota_exceeded")
|
|
26
25
|
PLAN_FEATURE_UNAVAILABLE = new("plan_feature_unavailable")
|
|
27
26
|
PLAN_LIMIT_EXCEEDED = new("plan_limit_exceeded")
|
|
28
|
-
PROJECT_KEY_REQUIRED = new("project_key_required")
|
|
29
27
|
ORGANIZATION_KEY_REQUIRED = new("organization_key_required")
|
|
30
28
|
MISSING_KEY_PERMISSION = new("missing_key_permission")
|
|
31
29
|
PROJECT_NOT_REACHABLE = new("project_not_reachable")
|
|
@@ -14,6 +14,7 @@ module ModerationApi
|
|
|
14
14
|
# Exactly what went wrong. Stable; safe to branch on. New codes may be added.
|
|
15
15
|
#
|
|
16
16
|
# - `invalid_request`: A parameter is invalid. `message` says which one.
|
|
17
|
+
# - `project_id_required`: An organization key called a project endpoint without naming the project in `Project-Id`, and the organization has more than one project.
|
|
17
18
|
# - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`.
|
|
18
19
|
field(
|
|
19
20
|
:code,
|
|
@@ -18,7 +18,6 @@ module ModerationApi
|
|
|
18
18
|
# - `quota_exceeded`: The organization has used all API requests on its plan.
|
|
19
19
|
# - `plan_feature_unavailable`: The current plan does not include this feature.
|
|
20
20
|
# - `plan_limit_exceeded`: The request goes over a limit of the current plan.
|
|
21
|
-
# - `project_key_required`: This endpoint needs a project API key, but an organization key was used.
|
|
22
21
|
# - `organization_key_required`: This endpoint needs an organization API key, but a project key was used.
|
|
23
22
|
# - `missing_key_permission`: The organization key does not have the permission this endpoint needs.
|
|
24
23
|
# - `project_not_reachable`: The organization key is limited to other projects.
|
|
@@ -15,11 +15,21 @@ module ModerationApi
|
|
|
15
15
|
field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}}
|
|
16
16
|
|
|
17
17
|
field :body, Models::Operations::AddWordlistWordsRequestBody, {'request': {'media_type': "application/json"}}
|
|
18
|
+
# The project to act on, when you call with an organization key. Optional when the organization has one project. A project key acts on its own project: naming another one is an error.
|
|
19
|
+
field(
|
|
20
|
+
:project_id,
|
|
21
|
+
Crystalline::Nilable.new(::String),
|
|
22
|
+
{'header': {'field_name': "Project-Id", 'style': "simple", 'explode': false}}
|
|
23
|
+
)
|
|
18
24
|
|
|
19
|
-
sig {
|
|
20
|
-
|
|
25
|
+
sig {
|
|
26
|
+
params(id: ::String, body: Models::Operations::AddWordlistWordsRequestBody, project_id: T.nilable(::String))
|
|
27
|
+
.void
|
|
28
|
+
}
|
|
29
|
+
def initialize(id:, body:, project_id: nil)
|
|
21
30
|
@id = id
|
|
22
31
|
@body = body
|
|
32
|
+
@project_id = project_id
|
|
23
33
|
end
|
|
24
34
|
|
|
25
35
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
@@ -27,6 +37,7 @@ module ModerationApi
|
|
|
27
37
|
return false unless other.is_a?(self.class)
|
|
28
38
|
return false unless @id == other.id
|
|
29
39
|
return false unless @body == other.body
|
|
40
|
+
return false unless @project_id == other.project_id
|
|
30
41
|
true
|
|
31
42
|
end
|
|
32
43
|
end
|