From 06c38f65e358fa0b0c91ce2eae25d406e075f0ae Mon Sep 17 00:00:00 2001 From: chrisdengso <8185683+chrisdengso@users.noreply.github.com> Date: Wed, 28 Oct 2026 13:39:07 +0000 Subject: [PATCH] feat: v1.3.0, API changes --- .speakeasy/gen.lock | 192 ++++- .speakeasy/gen.yaml | 2 +- .speakeasy/openapi.json | 674 ++++++++++++++++++ CHANGELOG.md | 14 + README.md | 5 + docs/Models/Operations/AllowContentRequest.md | 10 + .../Operations/AllowContentRequestBody.md | 11 + .../Models/Operations/AllowContentResponse.md | 11 + .../Operations/AllowContentResponseBody.md | 10 + docs/Models/Operations/BlockAuthorRequest.md | 10 + .../Operations/BlockAuthorRequestBody.md | 8 + docs/Models/Operations/BlockAuthorResponse.md | 11 + .../Operations/BlockAuthorResponseBody.md | 10 + .../Operations/ExecuteActionRequestBody.md | 18 +- .../Models/Operations/RejectContentRequest.md | 10 + .../Operations/RejectContentRequestBody.md | 11 + .../Operations/RejectContentResponse.md | 11 + .../Operations/RejectContentResponseBody.md | 10 + .../Models/Operations/SuspendAuthorRequest.md | 10 + .../Operations/SuspendAuthorRequestBody.md | 9 + .../Operations/SuspendAuthorResponse.md | 11 + .../Operations/SuspendAuthorResponseBody.md | 10 + .../Models/Operations/UnblockAuthorRequest.md | 10 + .../Operations/UnblockAuthorRequestBody.md | 8 + .../Operations/UnblockAuthorResponse.md | 11 + .../Operations/UnblockAuthorResponseBody.md | 10 + docs/sdks/authors/README.md | 176 ++++- docs/sdks/content/README.md | 116 +++ src/Authors.php | 378 ++++++++++ src/Content.php | 252 +++++++ src/Models/Operations/AllowContentRequest.php | 49 ++ .../Operations/AllowContentRequestBody.php | 64 ++ .../Operations/AllowContentResponse.php | 56 ++ .../Operations/AllowContentResponseBody.php | 31 + src/Models/Operations/BlockAuthorRequest.php | 49 ++ .../Operations/BlockAuthorRequestBody.php | 31 + src/Models/Operations/BlockAuthorResponse.php | 56 ++ .../Operations/BlockAuthorResponseBody.php | 31 + .../Operations/ExecuteActionRequestBody.php | 24 +- .../Operations/RejectContentRequest.php | 49 ++ .../Operations/RejectContentRequestBody.php | 64 ++ .../Operations/RejectContentResponse.php | 56 ++ .../Operations/RejectContentResponseBody.php | 31 + .../Operations/SuspendAuthorRequest.php | 49 ++ .../Operations/SuspendAuthorRequestBody.php | 42 ++ .../Operations/SuspendAuthorResponse.php | 56 ++ .../Operations/SuspendAuthorResponseBody.php | 31 + .../Operations/UnblockAuthorRequest.php | 49 ++ .../Operations/UnblockAuthorRequestBody.php | 31 + .../Operations/UnblockAuthorResponse.php | 56 ++ .../Operations/UnblockAuthorResponseBody.php | 31 + src/ModerationApi.php | 6 +- src/SDKConfiguration.php | 4 +- 53 files changed, 2948 insertions(+), 27 deletions(-) create mode 100644 docs/Models/Operations/AllowContentRequest.md create mode 100644 docs/Models/Operations/AllowContentRequestBody.md create mode 100644 docs/Models/Operations/AllowContentResponse.md create mode 100644 docs/Models/Operations/AllowContentResponseBody.md create mode 100644 docs/Models/Operations/BlockAuthorRequest.md create mode 100644 docs/Models/Operations/BlockAuthorRequestBody.md create mode 100644 docs/Models/Operations/BlockAuthorResponse.md create mode 100644 docs/Models/Operations/BlockAuthorResponseBody.md create mode 100644 docs/Models/Operations/RejectContentRequest.md create mode 100644 docs/Models/Operations/RejectContentRequestBody.md create mode 100644 docs/Models/Operations/RejectContentResponse.md create mode 100644 docs/Models/Operations/RejectContentResponseBody.md create mode 100644 docs/Models/Operations/SuspendAuthorRequest.md create mode 100644 docs/Models/Operations/SuspendAuthorRequestBody.md create mode 100644 docs/Models/Operations/SuspendAuthorResponse.md create mode 100644 docs/Models/Operations/SuspendAuthorResponseBody.md create mode 100644 docs/Models/Operations/UnblockAuthorRequest.md create mode 100644 docs/Models/Operations/UnblockAuthorRequestBody.md create mode 100644 docs/Models/Operations/UnblockAuthorResponse.md create mode 100644 docs/Models/Operations/UnblockAuthorResponseBody.md create mode 100644 src/Models/Operations/AllowContentRequest.php create mode 100644 src/Models/Operations/AllowContentRequestBody.php create mode 100644 src/Models/Operations/AllowContentResponse.php create mode 100644 src/Models/Operations/AllowContentResponseBody.php create mode 100644 src/Models/Operations/BlockAuthorRequest.php create mode 100644 src/Models/Operations/BlockAuthorRequestBody.php create mode 100644 src/Models/Operations/BlockAuthorResponse.php create mode 100644 src/Models/Operations/BlockAuthorResponseBody.php create mode 100644 src/Models/Operations/RejectContentRequest.php create mode 100644 src/Models/Operations/RejectContentRequestBody.php create mode 100644 src/Models/Operations/RejectContentResponse.php create mode 100644 src/Models/Operations/RejectContentResponseBody.php create mode 100644 src/Models/Operations/SuspendAuthorRequest.php create mode 100644 src/Models/Operations/SuspendAuthorRequestBody.php create mode 100644 src/Models/Operations/SuspendAuthorResponse.php create mode 100644 src/Models/Operations/SuspendAuthorResponseBody.php create mode 100644 src/Models/Operations/UnblockAuthorRequest.php create mode 100644 src/Models/Operations/UnblockAuthorRequestBody.php create mode 100644 src/Models/Operations/UnblockAuthorResponse.php create mode 100644 src/Models/Operations/UnblockAuthorResponseBody.php diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 66ec400..65d60e1 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 0199302d-9d48-4081-a021-a66e7a11ce41 management: - docChecksum: ed2fd953cba3e99fb81365252925a0d4 + docChecksum: d6bce8a263f0ec11d54bdf026957ba2f docVersion: 1.1.0 speakeasyVersion: internal generationVersion: internal - releaseVersion: 1.2.0 - configChecksum: 4e4cfea4aa60d3918e951e102b49ec3b + releaseVersion: 1.3.0 + configChecksum: cba30f585a63d0da38fb70b401b25d5e repoURL: https://github.com/moderation-api/sdk-php installationURL: https://github.com/moderation-api/sdk-php.git published: true @@ -157,6 +157,14 @@ trackedFiles: last_write_checksum: sha1:f92b2dc8f9edb7b969d66f7c14248eea6c456013 docs/Models/Operations/Alcohol.md: last_write_checksum: sha1:650e632d6f54d6ecc4ae7b164985c6a9c1dcce5f + docs/Models/Operations/AllowContentRequest.md: + last_write_checksum: sha1:926c83fc19f976f1a6fa9a2630317c3f6066b78a + docs/Models/Operations/AllowContentRequestBody.md: + last_write_checksum: sha1:b3bd697dd078bf5898c268f4f86acb6121679da7 + docs/Models/Operations/AllowContentResponse.md: + last_write_checksum: sha1:3c59f0e5234d4436bdedbdab07f6a9d3484ada87 + docs/Models/Operations/AllowContentResponseBody.md: + last_write_checksum: sha1:ef706d5884a3220f3952c421e754d1881bd4251e docs/Models/Operations/AudioRequest.md: last_write_checksum: sha1:422b19eb1169a2d5f0d655b8dc1b0cec50ebcc75 docs/Models/Operations/AudioResponse.md: @@ -167,6 +175,14 @@ trackedFiles: last_write_checksum: sha1:0c281a3cb84e007a7f614cb6295f94964f91d044 docs/Models/Operations/Block.md: last_write_checksum: sha1:334b51a56857c865c3777021eef19c61b8e41b37 + docs/Models/Operations/BlockAuthorRequest.md: + last_write_checksum: sha1:d9af222538fab3c36be9947efb3edc1a40ec3d4e + docs/Models/Operations/BlockAuthorRequestBody.md: + last_write_checksum: sha1:af9cba01dfb0d680ca3a5a96fe1af27b627a6dac + docs/Models/Operations/BlockAuthorResponse.md: + last_write_checksum: sha1:ec04a66beef1ed7de5be16c85f621dc48f4c9a97 + docs/Models/Operations/BlockAuthorResponseBody.md: + last_write_checksum: sha1:3f22ff567de13be79ddd48d29f7a0baf4fe418d7 docs/Models/Operations/BrandImpersonation.md: last_write_checksum: sha1:419b97d0825dbb7453231033af20b5190982c7ad docs/Models/Operations/Bucket.md: @@ -352,7 +368,7 @@ trackedFiles: docs/Models/Operations/ExecuteActionRequest.md: last_write_checksum: sha1:ba51c15455a750d4153362120759a57f3399cfe7 docs/Models/Operations/ExecuteActionRequestBody.md: - last_write_checksum: sha1:fec12bfabf9159c95312a01b419137d122841935 + last_write_checksum: sha1:975ff62c676f5d30d63793cb0596dcaebf19a8f7 docs/Models/Operations/ExecuteActionResponse.md: last_write_checksum: sha1:0b9f8a95be5a0a0da917452b4c8a07ce571b6555 docs/Models/Operations/ExecuteActionResponseBody.md: @@ -639,6 +655,14 @@ trackedFiles: last_write_checksum: sha1:18ad353107b85619d4bb580085e74b7e259b016e docs/Models/Operations/Recommendation.md: last_write_checksum: sha1:e993b79a726e21528eadaf98d7fc54a36312fb83 + docs/Models/Operations/RejectContentRequest.md: + last_write_checksum: sha1:4bfa7e95df310f47fd5ea1798586364e720541f0 + docs/Models/Operations/RejectContentRequestBody.md: + last_write_checksum: sha1:238ec54c0ff7ef2808c594ef5445af0c60481cdf + docs/Models/Operations/RejectContentResponse.md: + last_write_checksum: sha1:c841ccd3614ed3b803ebddcf7331ca169df4ff6a + docs/Models/Operations/RejectContentResponseBody.md: + last_write_checksum: sha1:38b38ac3eea268f31cf47acbd71183ff38363518 docs/Models/Operations/Religion.md: last_write_checksum: sha1:4dafe8419b1c34e4b9db06ddf46ebf4d2e6a70f2 docs/Models/Operations/RemoveWordlistWordsRequest.md: @@ -707,6 +731,14 @@ trackedFiles: last_write_checksum: sha1:e9c17f5657f3d9e6ef368d40240b85c53df4dff3 docs/Models/Operations/SubmitContentResponseBody.md: last_write_checksum: sha1:99be7bdfc311d24844239d461b3cae9eacb91c2c + docs/Models/Operations/SuspendAuthorRequest.md: + last_write_checksum: sha1:fdf516d9d6e5d12af517e8c464c10d8aa2f3250b + docs/Models/Operations/SuspendAuthorRequestBody.md: + last_write_checksum: sha1:7b3b3505da81354bece090846ee5eb7363c501b3 + docs/Models/Operations/SuspendAuthorResponse.md: + last_write_checksum: sha1:3013e610251a50e98bce7d3424f373db7dcd62d4 + docs/Models/Operations/SuspendAuthorResponseBody.md: + last_write_checksum: sha1:ff99694686da8dcf2fa1745cea131c352e423b73 docs/Models/Operations/TextRequest.md: last_write_checksum: sha1:f83a68d8eff40ce3a0103fb4ffba61c569570cef docs/Models/Operations/TextResponse.md: @@ -733,6 +765,14 @@ trackedFiles: last_write_checksum: sha1:5c2b0f11ca4b9c12a113f1de7a23ab5520ec2b67 docs/Models/Operations/URLRisk.md: last_write_checksum: sha1:82fa237bb807096341a656ae2794efc39fb2c40b + docs/Models/Operations/UnblockAuthorRequest.md: + last_write_checksum: sha1:01c91b4736aa18a805beecdd5dc5a7bf7112a0d5 + docs/Models/Operations/UnblockAuthorRequestBody.md: + last_write_checksum: sha1:5657e1d231532d3fbc9442282031b64d2aaa0da9 + docs/Models/Operations/UnblockAuthorResponse.md: + last_write_checksum: sha1:b50ceac24e4cde9d9e827acb44f2b1dc5dd33f63 + docs/Models/Operations/UnblockAuthorResponseBody.md: + last_write_checksum: sha1:af868cee06a14fe460e0c033458bdd6a573bab22 docs/Models/Operations/UnicodeSpoofing.md: last_write_checksum: sha1:dcc11bf5e62c90b2ac0c2f11329dfdabd0c205ef docs/Models/Operations/UnresolveQueueItemRequest.md: @@ -834,11 +874,11 @@ trackedFiles: docs/sdks/apikeys/README.md: last_write_checksum: sha1:21a124371058a8c58c26e033e3fa4038464f89bc docs/sdks/authors/README.md: - last_write_checksum: sha1:18af7d0f9fc5be9e02dda8fc063870eb02347a0d + last_write_checksum: sha1:c09159cc32e44bc539ad403d746266767dc1b8fb docs/sdks/channels/README.md: last_write_checksum: sha1:784bad3ada3395f36a632bf3a16f7cd944cb9c5e docs/sdks/content/README.md: - last_write_checksum: sha1:79d4af3bc1f4c99ea7df6a1c85e6dd288ff08494 + last_write_checksum: sha1:64ddd93e4d2dca3fb7f7df27c04eb1ee82a4d680 docs/sdks/feedback/README.md: last_write_checksum: sha1:c94088099f0c490ede88e5a6e31de669fe2a2cd5 docs/sdks/items/README.md: @@ -872,11 +912,11 @@ trackedFiles: src/ApiKeys.php: last_write_checksum: sha1:ab8c7e1f03ca30a732ff145b5675d841931af57c src/Authors.php: - last_write_checksum: sha1:f14f1258fbd0820f47b9c232a09c5ebb0b32b846 + last_write_checksum: sha1:851fe69b47dd3c2c577a11fbf441137e95cced0d src/Channels.php: last_write_checksum: sha1:e21a72abd3bcc3c758a5b6be405a9c9ae913e2f6 src/Content.php: - last_write_checksum: sha1:587e1073d70b1ba8b5a127dcba655d7259aa1194 + last_write_checksum: sha1:0af180b999501ccaf0bd250ea6c63531a8859f2a src/Feedback.php: last_write_checksum: sha1:9bcf1711ab2b98d185316c243fea74a34e33d949 src/Hooks/AfterErrorContext.php: @@ -1043,6 +1083,14 @@ trackedFiles: last_write_checksum: sha1:65862e2ce8996c4e57429338f779efa1a8638d7e src/Models/Operations/Alcohol.php: last_write_checksum: sha1:21d86b9a5f1545d4e235b5cb82ef6fb685f255fa + src/Models/Operations/AllowContentRequest.php: + last_write_checksum: sha1:4b0f3260198f42f4cddf8bb53c0c814affc0e4f5 + src/Models/Operations/AllowContentRequestBody.php: + last_write_checksum: sha1:643cdaca46f2ee0ac4d39e1a251f4f9665ee186a + src/Models/Operations/AllowContentResponse.php: + last_write_checksum: sha1:35461ee15818b7345da7746580e08137df307948 + src/Models/Operations/AllowContentResponseBody.php: + last_write_checksum: sha1:733809c61e8fc402500f8619e26940a14cd12216 src/Models/Operations/AudioRequest.php: last_write_checksum: sha1:15aee9a8a6e255b6c2f33b113ea61dd2e9cc8a2a src/Models/Operations/AudioResponse.php: @@ -1053,6 +1101,14 @@ trackedFiles: last_write_checksum: sha1:2a5fee2268a9f25ce53ba19c94fff59bde6a4482 src/Models/Operations/Block.php: last_write_checksum: sha1:75526ef624ec34529e56e0200dcefa281a58911f + src/Models/Operations/BlockAuthorRequest.php: + last_write_checksum: sha1:ee0590076fd62035a2ed3719bebba06dacf3577c + src/Models/Operations/BlockAuthorRequestBody.php: + last_write_checksum: sha1:7bda5cc226ff8c2358074173e2029eb7879e21ef + src/Models/Operations/BlockAuthorResponse.php: + last_write_checksum: sha1:6760d91dc7a7cdd4b4b8fec1bdfff7e27c04cdaf + src/Models/Operations/BlockAuthorResponseBody.php: + last_write_checksum: sha1:b2de1184a8c7cb13770a60da530e3743537ce30d src/Models/Operations/BrandImpersonation.php: last_write_checksum: sha1:250e4cb1e589d9cff3b6df3e2bc25f25bda7308b src/Models/Operations/Bucket.php: @@ -1232,7 +1288,7 @@ trackedFiles: src/Models/Operations/ExecuteActionRequest.php: last_write_checksum: sha1:ad852b1645811a78be00900705b5d423a5c1df9b src/Models/Operations/ExecuteActionRequestBody.php: - last_write_checksum: sha1:3136009ab309a9f9b23a6618f6357cf8bcfe9351 + last_write_checksum: sha1:2f948c83e4be50358247bdea6e8431bf023b7d78 src/Models/Operations/ExecuteActionResponse.php: last_write_checksum: sha1:3fd15a00a8bccc0167ee30686ebc8efcf25a3652 src/Models/Operations/ExecuteActionResponseBody.php: @@ -1511,6 +1567,14 @@ trackedFiles: last_write_checksum: sha1:6bf4ea761289ac785e0255c7f3804d9565d3cd96 src/Models/Operations/Recommendation.php: last_write_checksum: sha1:f4c2a466359c4367ee00eee1a64777520561f4df + src/Models/Operations/RejectContentRequest.php: + last_write_checksum: sha1:1328c0eb9d9343c589227667f3bc11ce92de4ccd + src/Models/Operations/RejectContentRequestBody.php: + last_write_checksum: sha1:6c4390e3df92b9f16ea76d585e63849f81282fae + src/Models/Operations/RejectContentResponse.php: + last_write_checksum: sha1:89f3ee0dcf47ee58819fbd8dfe6aaf0449fdeb4a + src/Models/Operations/RejectContentResponseBody.php: + last_write_checksum: sha1:f46d6ee4c391fea8abcd7295c3c03abdc6515f90 src/Models/Operations/Religion.php: last_write_checksum: sha1:77cf485d673e50a293b5261c256cb572133adac7 src/Models/Operations/RemoveWordlistWordsRequest.php: @@ -1577,6 +1641,14 @@ trackedFiles: last_write_checksum: sha1:69f1b46bd44843fddb5c9ac81e89607ad6ca0019 src/Models/Operations/SubmitContentResponseBody.php: last_write_checksum: sha1:1b1de76a0c0045485bbfe5060550b5b5867ced2e + src/Models/Operations/SuspendAuthorRequest.php: + last_write_checksum: sha1:fd49864a80df1f6a35a1ffa2654251a7b0995317 + src/Models/Operations/SuspendAuthorRequestBody.php: + last_write_checksum: sha1:6b71df2e76c699102c0023ba9502610307cd6cd2 + src/Models/Operations/SuspendAuthorResponse.php: + last_write_checksum: sha1:bb6515f2f7e0be421d371ff70f84eb08ffa673c5 + src/Models/Operations/SuspendAuthorResponseBody.php: + last_write_checksum: sha1:0d93a0ed3257b2f5826d6dcac32506e5b2397210 src/Models/Operations/TextRequest.php: last_write_checksum: sha1:de9a86c059fc52f9be85775b7b0ae02f3f766f2c src/Models/Operations/TextResponse.php: @@ -1603,6 +1675,14 @@ trackedFiles: last_write_checksum: sha1:af31a9e2dbcc0b3d5515e8b9862ee120dc4dd8df src/Models/Operations/URLRisk.php: last_write_checksum: sha1:8efa82103426e087409aa5ebdb81accdf03dd407 + src/Models/Operations/UnblockAuthorRequest.php: + last_write_checksum: sha1:c927ba2d5eb26040668ae85345dbe37652e0535d + src/Models/Operations/UnblockAuthorRequestBody.php: + last_write_checksum: sha1:8e08ea2717c00d05e47ee004ea0a98361f0d0126 + src/Models/Operations/UnblockAuthorResponse.php: + last_write_checksum: sha1:47ffa3223577a777121f875576011442c179298f + src/Models/Operations/UnblockAuthorResponseBody.php: + last_write_checksum: sha1:c7bbdc50394aba4df6b98d748407ed42a34dda80 src/Models/Operations/UnicodeSpoofing.php: last_write_checksum: sha1:280971a1558295ec10314a1f8ea945083b2b10e2 src/Models/Operations/UnresolveQueueItemRequest.php: @@ -1696,7 +1776,7 @@ trackedFiles: src/Models/Operations/Weapons.php: last_write_checksum: sha1:6f08c11a3765a35008407445842f40c1b602db24 src/ModerationApi.php: - last_write_checksum: sha1:66997e994eb7739c00d6025c2c1cfee7e32108c1 + last_write_checksum: sha1:3fdd8d6b53fe118143b31df929d5392e2f0f0fb9 src/ModerationApiBuilder.php: last_write_checksum: sha1:16809f5bed82b4ad4c18f3322de18d04e32a372d src/Projects.php: @@ -1704,7 +1784,7 @@ trackedFiles: src/Queue.php: last_write_checksum: sha1:be966a810109ae154cee3d97d78b3dec2c7512ef src/SDKConfiguration.php: - last_write_checksum: sha1:649e776e2649b016ac683bf1e01e36d49e23ab4f + last_write_checksum: sha1:173a42d3f25b734c175524888318a21c747aa42b src/Utils/BigDecimalHandler.php: last_write_checksum: sha1:2d36b5ae690b042acfcdfe7e7277d44c5055416f src/Utils/BigIntHandler.php: @@ -2742,4 +2822,94 @@ examples: application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://impractical-bin.info/"} "429": application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://damaged-bandwidth.name"} + blockAuthor: + speakeasy-default-block-author: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"success": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://mammoth-appliance.org/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://clumsy-ectoderm.com/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://square-custody.com"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://mysterious-dime.name/"} + suspendAuthor: + speakeasy-default-suspend-author: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"success": true} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://cluttered-hubris.name/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://far-off-farm.net/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://scented-farmer.info"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://miserly-cuckoo.org/"} + unblockAuthor: + speakeasy-default-unblock-author: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"success": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://utter-cornet.org"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://oddball-bathhouse.biz/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://apprehensive-fisherman.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://unhappy-simple.net/"} + rejectContent: + speakeasy-default-reject-content: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"success": true} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://expert-pasta.com"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://vibrant-adaptation.name"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://boiling-gym.com/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://spanish-backburn.net"} + allowContent: + speakeasy-default-allow-content: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"success": true} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://earnest-fishery.com"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://meager-climb.biz/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://confused-bell.org"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://nervous-partridge.org/"} examplesVersion: 1.0.2 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 72c8485..dd9d618 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false php: - version: 1.2.0 + version: 1.3.0 additionalDependencies: autoload: {} autoload-dev: {} diff --git a/.speakeasy/openapi.json b/.speakeasy/openapi.json index cabb255..9a2cf7e 100644 --- a/.speakeasy/openapi.json +++ b/.speakeasy/openapi.json @@ -5103,6 +5103,14 @@ "description": "Optional duration in milliseconds for actions with timeouts", "type": "number", "minimum": 0 + }, + "moderator": { + "description": "The user ID or email of the organization member who made the decision. The action is recorded as theirs.", + "type": "string" + }, + "createCasebookCase": { + "description": "Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System.", + "type": "boolean" } }, "required": [ @@ -5342,6 +5350,672 @@ "x-speakeasy-ignore": true } }, + "/content/{id}/reject": { + "post": { + "operationId": "rejectContent", + "summary": "Reject content", + "description": "Reject a content item with the built-in reject action, and resolve it in the review queue.", + "tags": [ + "Content" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The content ID you sent when you submitted the content, or the ID Moderation API assigned." + }, + "required": true, + "description": "The content ID you sent when you submitted the content, or the ID Moderation API assigned." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + }, + "queueId": { + "description": "The queue the content is reviewed in. Defaults to the project's default queue.", + "type": "string" + }, + "moderator": { + "description": "The user ID or email of the organization member who made the decision. The action is recorded as theirs.", + "type": "string" + }, + "createCasebookCase": { + "description": "Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System.", + "type": "boolean" + } + } + }, + "example": { + "reason": "Spam" + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "content", + "x-speakeasy-name-override": "reject", + "x-speakeasy-mcp": { + "title": "Reject content", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/content/{id}/allow": { + "post": { + "operationId": "allowContent", + "summary": "Allow content", + "description": "Allow a content item with the built-in allow action, and resolve it in the review queue.", + "tags": [ + "Content" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "The content ID you sent when you submitted the content, or the ID Moderation API assigned." + }, + "required": true, + "description": "The content ID you sent when you submitted the content, or the ID Moderation API assigned." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + }, + "queueId": { + "description": "The queue the content is reviewed in. Defaults to the project's default queue.", + "type": "string" + }, + "moderator": { + "description": "The user ID or email of the organization member who made the decision. The action is recorded as theirs.", + "type": "string" + }, + "createCasebookCase": { + "description": "Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System.", + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "content", + "x-speakeasy-name-override": "allow", + "x-speakeasy-mcp": { + "title": "Allow content", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, + "/authors/{id}/block": { + "post": { + "operationId": "blockAuthor", + "summary": "Block author", + "description": "Block an author with the built-in block action. A blocked author cannot post new content until unblocked.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "block", + "x-speakeasy-mcp": { + "title": "Block author", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/authors/{id}/suspend": { + "post": { + "operationId": "suspendAuthor", + "summary": "Suspend author", + "description": "Block an author for a limited time with the built-in suspend action.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + }, + "duration": { + "description": "How long the suspension lasts, in milliseconds. Defaults to 24 hours.", + "type": "number", + "minimum": 0 + } + } + }, + "example": { + "reason": "Violation of community guidelines", + "duration": 604800000 + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "suspend", + "x-speakeasy-mcp": { + "title": "Suspend author", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true + } + } + }, + "/authors/{id}/unblock": { + "post": { + "operationId": "unblockAuthor", + "summary": "Unblock author", + "description": "Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again.", + "tags": [ + "Authors" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "Either external ID or the ID assigned by moderation API." + }, + "required": true, + "description": "Either external ID or the ID assigned by moderation API." + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "description": "Why the action was taken. Saved with the action and sent in the webhook event.", + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action executed successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "description": "Whether the action was executed successfully" + } + }, + "required": [ + "success" + ], + "additionalProperties": false, + "description": "Execution result" + } + } + } + }, + "400": { + "description": "Invalid input data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "authors", + "x-speakeasy-name-override": "unblock", + "x-speakeasy-mcp": { + "title": "Unblock author", + "scopes": [ + "write" + ], + "readOnlyHint": false, + "destructiveHint": false + } + } + }, "/webhooks": { "get": { "operationId": "listWebhooks", diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c9a3b2..2d399d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 1.3.0 (2026-10-28) + +Full Changelog: [v1.2.0...v1.3.0](https://github.com/moderation-api/sdk-php/compare/v1.2.0...v1.3.0) + +### API changes + +- `POST /actions/execute`: added the new optional request property `createCasebookCase` +- `POST /actions/execute`: added the new optional request property `moderator` +- `POST /authors/{id}/block`: endpoint added +- `POST /authors/{id}/suspend`: endpoint added +- `POST /authors/{id}/unblock`: endpoint added +- `POST /content/{id}/allow`: endpoint added +- `POST /content/{id}/reject`: endpoint added + ## 1.2.0 (2026-10-26) Full Changelog: [v1.1.1...v1.2.0](https://github.com/moderation-api/sdk-php/compare/v1.1.1...v1.2.0) diff --git a/README.md b/README.md index 5829e40..ef3669b 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,9 @@ Create the organization client only where you manage projects and channels, for * [retrieve](docs/sdks/authors/README.md#retrieve) - Get author details * [update](docs/sdks/authors/README.md#update) - Update author details * [delete](docs/sdks/authors/README.md#delete) - Delete an author +* [block](docs/sdks/authors/README.md#block) - Block author +* [suspend](docs/sdks/authors/README.md#suspend) - Suspend author +* [unblock](docs/sdks/authors/README.md#unblock) - Unblock author ### [Channels](docs/sdks/channels/README.md) @@ -320,6 +323,8 @@ Create the organization client only where you manage projects and channels, for ### [Content](docs/sdks/content/README.md) +* [reject](docs/sdks/content/README.md#reject) - Reject content +* [allow](docs/sdks/content/README.md#allow) - Allow content * [submit](docs/sdks/content/README.md#submit) - Submit content ### [Feedback](docs/sdks/feedback/README.md) diff --git a/docs/Models/Operations/AllowContentRequest.md b/docs/Models/Operations/AllowContentRequest.md new file mode 100644 index 0000000..a36c407 --- /dev/null +++ b/docs/Models/Operations/AllowContentRequest.md @@ -0,0 +1,10 @@ +# AllowContentRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The content ID you sent when you submitted the content, or the ID Moderation API assigned. | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `body` | [Operations\AllowContentRequestBody](../../Models/Operations/AllowContentRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/AllowContentRequestBody.md b/docs/Models/Operations/AllowContentRequestBody.md new file mode 100644 index 0000000..f81902c --- /dev/null +++ b/docs/Models/Operations/AllowContentRequestBody.md @@ -0,0 +1,11 @@ +# AllowContentRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reason` | *?string* | :heavy_minus_sign: | Why the action was taken. Saved with the action and sent in the webhook event. | +| `queueId` | *?string* | :heavy_minus_sign: | The queue the content is reviewed in. Defaults to the project's default queue. | +| `moderator` | *?string* | :heavy_minus_sign: | The user ID or email of the organization member who made the decision. The action is recorded as theirs. | +| `createCasebookCase` | *?bool* | :heavy_minus_sign: | Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. | \ No newline at end of file diff --git a/docs/Models/Operations/AllowContentResponse.md b/docs/Models/Operations/AllowContentResponse.md new file mode 100644 index 0000000..1817564 --- /dev/null +++ b/docs/Models/Operations/AllowContentResponse.md @@ -0,0 +1,11 @@ +# AllowContentResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [?Operations\AllowContentResponseBody](../../Models/Operations/AllowContentResponseBody.md) | :heavy_minus_sign: | Action executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/AllowContentResponseBody.md b/docs/Models/Operations/AllowContentResponseBody.md new file mode 100644 index 0000000..e328e47 --- /dev/null +++ b/docs/Models/Operations/AllowContentResponseBody.md @@ -0,0 +1,10 @@ +# AllowContentResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *bool* | :heavy_check_mark: | Whether the action was executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/BlockAuthorRequest.md b/docs/Models/Operations/BlockAuthorRequest.md new file mode 100644 index 0000000..3a04634 --- /dev/null +++ b/docs/Models/Operations/BlockAuthorRequest.md @@ -0,0 +1,10 @@ +# BlockAuthorRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `body` | [Operations\BlockAuthorRequestBody](../../Models/Operations/BlockAuthorRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/BlockAuthorRequestBody.md b/docs/Models/Operations/BlockAuthorRequestBody.md new file mode 100644 index 0000000..1a877d6 --- /dev/null +++ b/docs/Models/Operations/BlockAuthorRequestBody.md @@ -0,0 +1,8 @@ +# BlockAuthorRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `reason` | *?string* | :heavy_minus_sign: | Why the action was taken. Saved with the action and sent in the webhook event. | \ No newline at end of file diff --git a/docs/Models/Operations/BlockAuthorResponse.md b/docs/Models/Operations/BlockAuthorResponse.md new file mode 100644 index 0000000..9f0a5d8 --- /dev/null +++ b/docs/Models/Operations/BlockAuthorResponse.md @@ -0,0 +1,11 @@ +# BlockAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [?Operations\BlockAuthorResponseBody](../../Models/Operations/BlockAuthorResponseBody.md) | :heavy_minus_sign: | Action executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/BlockAuthorResponseBody.md b/docs/Models/Operations/BlockAuthorResponseBody.md new file mode 100644 index 0000000..f7dbe8b --- /dev/null +++ b/docs/Models/Operations/BlockAuthorResponseBody.md @@ -0,0 +1,10 @@ +# BlockAuthorResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *bool* | :heavy_check_mark: | Whether the action was executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/ExecuteActionRequestBody.md b/docs/Models/Operations/ExecuteActionRequestBody.md index 2e0c8c0..f4a0f98 100644 --- a/docs/Models/Operations/ExecuteActionRequestBody.md +++ b/docs/Models/Operations/ExecuteActionRequestBody.md @@ -5,11 +5,13 @@ Input parameters ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `actionKey` | *string* | :heavy_check_mark: | ID or key of the action to execute | -| `contentIds` | array<*string*> | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | -| `authorIds` | array<*string*> | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | -| `value` | *?string* | :heavy_minus_sign: | Optional value to provide with the action | -| `queueId` | *?string* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | -| `duration` | *?float* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `actionKey` | *string* | :heavy_check_mark: | ID or key of the action to execute | +| `contentIds` | array<*string*> | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | +| `authorIds` | array<*string*> | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | +| `value` | *?string* | :heavy_minus_sign: | Optional value to provide with the action | +| `queueId` | *?string* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | +| `duration` | *?float* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | +| `moderator` | *?string* | :heavy_minus_sign: | The user ID or email of the organization member who made the decision. The action is recorded as theirs. | +| `createCasebookCase` | *?bool* | :heavy_minus_sign: | Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. | \ No newline at end of file diff --git a/docs/Models/Operations/RejectContentRequest.md b/docs/Models/Operations/RejectContentRequest.md new file mode 100644 index 0000000..1543841 --- /dev/null +++ b/docs/Models/Operations/RejectContentRequest.md @@ -0,0 +1,10 @@ +# RejectContentRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The content ID you sent when you submitted the content, or the ID Moderation API assigned. | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `body` | [Operations\RejectContentRequestBody](../../Models/Operations/RejectContentRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/RejectContentRequestBody.md b/docs/Models/Operations/RejectContentRequestBody.md new file mode 100644 index 0000000..4032cc9 --- /dev/null +++ b/docs/Models/Operations/RejectContentRequestBody.md @@ -0,0 +1,11 @@ +# RejectContentRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reason` | *?string* | :heavy_minus_sign: | Why the action was taken. Saved with the action and sent in the webhook event. | +| `queueId` | *?string* | :heavy_minus_sign: | The queue the content is reviewed in. Defaults to the project's default queue. | +| `moderator` | *?string* | :heavy_minus_sign: | The user ID or email of the organization member who made the decision. The action is recorded as theirs. | +| `createCasebookCase` | *?bool* | :heavy_minus_sign: | Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. | \ No newline at end of file diff --git a/docs/Models/Operations/RejectContentResponse.md b/docs/Models/Operations/RejectContentResponse.md new file mode 100644 index 0000000..5bd7f02 --- /dev/null +++ b/docs/Models/Operations/RejectContentResponse.md @@ -0,0 +1,11 @@ +# RejectContentResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [?Operations\RejectContentResponseBody](../../Models/Operations/RejectContentResponseBody.md) | :heavy_minus_sign: | Action executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/RejectContentResponseBody.md b/docs/Models/Operations/RejectContentResponseBody.md new file mode 100644 index 0000000..f4233a4 --- /dev/null +++ b/docs/Models/Operations/RejectContentResponseBody.md @@ -0,0 +1,10 @@ +# RejectContentResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *bool* | :heavy_check_mark: | Whether the action was executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/SuspendAuthorRequest.md b/docs/Models/Operations/SuspendAuthorRequest.md new file mode 100644 index 0000000..5c8d65b --- /dev/null +++ b/docs/Models/Operations/SuspendAuthorRequest.md @@ -0,0 +1,10 @@ +# SuspendAuthorRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `body` | [Operations\SuspendAuthorRequestBody](../../Models/Operations/SuspendAuthorRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SuspendAuthorRequestBody.md b/docs/Models/Operations/SuspendAuthorRequestBody.md new file mode 100644 index 0000000..e908ffd --- /dev/null +++ b/docs/Models/Operations/SuspendAuthorRequestBody.md @@ -0,0 +1,9 @@ +# SuspendAuthorRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `reason` | *?string* | :heavy_minus_sign: | Why the action was taken. Saved with the action and sent in the webhook event. | +| `duration` | *?float* | :heavy_minus_sign: | How long the suspension lasts, in milliseconds. Defaults to 24 hours. | \ No newline at end of file diff --git a/docs/Models/Operations/SuspendAuthorResponse.md b/docs/Models/Operations/SuspendAuthorResponse.md new file mode 100644 index 0000000..ca566c0 --- /dev/null +++ b/docs/Models/Operations/SuspendAuthorResponse.md @@ -0,0 +1,11 @@ +# SuspendAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [?Operations\SuspendAuthorResponseBody](../../Models/Operations/SuspendAuthorResponseBody.md) | :heavy_minus_sign: | Action executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/SuspendAuthorResponseBody.md b/docs/Models/Operations/SuspendAuthorResponseBody.md new file mode 100644 index 0000000..bfce69d --- /dev/null +++ b/docs/Models/Operations/SuspendAuthorResponseBody.md @@ -0,0 +1,10 @@ +# SuspendAuthorResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *bool* | :heavy_check_mark: | Whether the action was executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/UnblockAuthorRequest.md b/docs/Models/Operations/UnblockAuthorRequest.md new file mode 100644 index 0000000..11f6dbe --- /dev/null +++ b/docs/Models/Operations/UnblockAuthorRequest.md @@ -0,0 +1,10 @@ +# UnblockAuthorRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `body` | [Operations\UnblockAuthorRequestBody](../../Models/Operations/UnblockAuthorRequestBody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/UnblockAuthorRequestBody.md b/docs/Models/Operations/UnblockAuthorRequestBody.md new file mode 100644 index 0000000..c4cd160 --- /dev/null +++ b/docs/Models/Operations/UnblockAuthorRequestBody.md @@ -0,0 +1,8 @@ +# UnblockAuthorRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `reason` | *?string* | :heavy_minus_sign: | Why the action was taken. Saved with the action and sent in the webhook event. | \ No newline at end of file diff --git a/docs/Models/Operations/UnblockAuthorResponse.md b/docs/Models/Operations/UnblockAuthorResponse.md new file mode 100644 index 0000000..c0ce3d3 --- /dev/null +++ b/docs/Models/Operations/UnblockAuthorResponse.md @@ -0,0 +1,11 @@ +# UnblockAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [?Operations\UnblockAuthorResponseBody](../../Models/Operations/UnblockAuthorResponseBody.md) | :heavy_minus_sign: | Action executed successfully | \ No newline at end of file diff --git a/docs/Models/Operations/UnblockAuthorResponseBody.md b/docs/Models/Operations/UnblockAuthorResponseBody.md new file mode 100644 index 0000000..f03a2a8 --- /dev/null +++ b/docs/Models/Operations/UnblockAuthorResponseBody.md @@ -0,0 +1,10 @@ +# UnblockAuthorResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *bool* | :heavy_check_mark: | Whether the action was executed successfully | \ No newline at end of file diff --git a/docs/sdks/authors/README.md b/docs/sdks/authors/README.md index 633c5eb..2e1120b 100644 --- a/docs/sdks/authors/README.md +++ b/docs/sdks/authors/README.md @@ -9,6 +9,9 @@ * [retrieve](#retrieve) - Get author details * [update](#update) - Update author details * [delete](#delete) - Delete an author +* [block](#block) - Block author +* [suspend](#suspend) - Suspend author +* [unblock](#unblock) - Unblock author ## list @@ -298,4 +301,175 @@ if ($response->object !== null) { | Errors\NotFoundError | 404 | application/json | | Errors\RateLimitError | 429 | application/json | | Errors\InternalServerError | 500 | application/json | -| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file +| Errors\APIException | 4XX, 5XX | \*/\* | + +## block + +Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + +### Example Usage + + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use ModerationApi; +use ModerationApi\Models\Operations; + +$sdk = ModerationApi\ModerationApi::builder() + ->setSecurity( + '' + ) + ->build(); + +$body = new Operations\BlockAuthorRequestBody(); + +$response = $sdk->authors->block( + id: '', + body: $body + +); + +if ($response->object !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [Operations\BlockAuthorRequestBody](../../Models/Operations/BlockAuthorRequestBody.md) | :heavy_check_mark: | N/A | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | + +### Response + +**[?Operations\BlockAuthorResponse](../../Models/Operations/BlockAuthorResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\BadRequestError | 400 | application/json | +| Errors\AuthenticationError | 401 | application/json | +| Errors\NotFoundError | 404 | application/json | +| Errors\RateLimitError | 429 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## suspend + +Block an author for a limited time with the built-in suspend action. + +### Example Usage + + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use ModerationApi; +use ModerationApi\Models\Operations; + +$sdk = ModerationApi\ModerationApi::builder() + ->setSecurity( + '' + ) + ->build(); + +$body = new Operations\SuspendAuthorRequestBody( + reason: 'Violation of community guidelines', + duration: 604800000, +); + +$response = $sdk->authors->suspend( + id: '', + body: $body + +); + +if ($response->object !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [Operations\SuspendAuthorRequestBody](../../Models/Operations/SuspendAuthorRequestBody.md) | :heavy_check_mark: | N/A | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | + +### Response + +**[?Operations\SuspendAuthorResponse](../../Models/Operations/SuspendAuthorResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\BadRequestError | 400 | application/json | +| Errors\AuthenticationError | 401 | application/json | +| Errors\NotFoundError | 404 | application/json | +| Errors\RateLimitError | 429 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## unblock + +Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + +### Example Usage + + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use ModerationApi; +use ModerationApi\Models\Operations; + +$sdk = ModerationApi\ModerationApi::builder() + ->setSecurity( + '' + ) + ->build(); + +$body = new Operations\UnblockAuthorRequestBody(); + +$response = $sdk->authors->unblock( + id: '', + body: $body + +); + +if ($response->object !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [Operations\UnblockAuthorRequestBody](../../Models/Operations/UnblockAuthorRequestBody.md) | :heavy_check_mark: | N/A | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | + +### Response + +**[?Operations\UnblockAuthorResponse](../../Models/Operations/UnblockAuthorResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\BadRequestError | 400 | application/json | +| Errors\AuthenticationError | 401 | application/json | +| Errors\NotFoundError | 404 | application/json | +| Errors\RateLimitError | 429 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/content/README.md b/docs/sdks/content/README.md index 0439d12..7e5bb4e 100644 --- a/docs/sdks/content/README.md +++ b/docs/sdks/content/README.md @@ -4,8 +4,124 @@ ### Available Operations +* [reject](#reject) - Reject content +* [allow](#allow) - Allow content * [submit](#submit) - Submit content +## reject + +Reject a content item with the built-in reject action, and resolve it in the review queue. + +### Example Usage + + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use ModerationApi; +use ModerationApi\Models\Operations; + +$sdk = ModerationApi\ModerationApi::builder() + ->setSecurity( + '' + ) + ->build(); + +$body = new Operations\RejectContentRequestBody( + reason: 'Spam', +); + +$response = $sdk->content->reject( + id: '', + body: $body + +); + +if ($response->object !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The content ID you sent when you submitted the content, or the ID Moderation API assigned. | +| `body` | [Operations\RejectContentRequestBody](../../Models/Operations/RejectContentRequestBody.md) | :heavy_check_mark: | N/A | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | + +### Response + +**[?Operations\RejectContentResponse](../../Models/Operations/RejectContentResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\BadRequestError | 400 | application/json | +| Errors\AuthenticationError | 401 | application/json | +| Errors\NotFoundError | 404 | application/json | +| Errors\RateLimitError | 429 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## allow + +Allow a content item with the built-in allow action, and resolve it in the review queue. + +### Example Usage + + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use ModerationApi; +use ModerationApi\Models\Operations; + +$sdk = ModerationApi\ModerationApi::builder() + ->setSecurity( + '' + ) + ->build(); + +$body = new Operations\AllowContentRequestBody(); + +$response = $sdk->content->allow( + id: '', + body: $body + +); + +if ($response->object !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The content ID you sent when you submitted the content, or the ID Moderation API assigned. | +| `body` | [Operations\AllowContentRequestBody](../../Models/Operations/AllowContentRequestBody.md) | :heavy_check_mark: | N/A | +| `projectId` | *?string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | + +### Response + +**[?Operations\AllowContentResponse](../../Models/Operations/AllowContentResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\BadRequestError | 400 | application/json | +| Errors\AuthenticationError | 401 | application/json | +| Errors\NotFoundError | 404 | application/json | +| Errors\RateLimitError | 429 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + ## submit Submit content diff --git a/src/Authors.php b/src/Authors.php index a832e64..d25ee4c 100644 --- a/src/Authors.php +++ b/src/Authors.php @@ -44,6 +44,132 @@ public function getUrl(string $baseUrl, array $urlVariables): string return Utils\Utils::templateUrl($baseUrl, $urlVariables); } + /** + * Block author + * + * Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + * + * @param \ModerationApi\Models\Operations\BlockAuthorRequestBody $body + * @param string $id + * @param ?string $projectId + * @return \ModerationApi\Models\Operations\BlockAuthorResponse + * @throws \ModerationApi\Models\Errors\APIException + */ + public function block(Operations\BlockAuthorRequestBody $body, string $id, ?string $projectId = null, ?Options $options = null): Operations\BlockAuthorResponse + { + $request = new Operations\BlockAuthorRequest( + id: $id, + body: $body, + projectId: $projectId, + ); + $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/authors/{id}/block', Operations\BlockAuthorRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'body', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); + if (! array_key_exists('headers', $httpOptions)) { + $httpOptions['headers'] = []; + } + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'blockAuthor', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + if (Utils\Utils::matchStatusCodes($httpResponse->getStatusCode(), ['4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Operations\BlockAuthorResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\BlockAuthorResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + object: $obj); + + return $response; + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\BadRequestError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\AuthenticationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\NotFoundError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['429'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\RateLimitError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + /** * Create a new author * @@ -664,6 +790,258 @@ public function list(?Operations\ListAuthorsRequest $request = null, ?Options $o } } + /** + * Suspend author + * + * Block an author for a limited time with the built-in suspend action. + * + * @param \ModerationApi\Models\Operations\SuspendAuthorRequestBody $body + * @param string $id + * @param ?string $projectId + * @return \ModerationApi\Models\Operations\SuspendAuthorResponse + * @throws \ModerationApi\Models\Errors\APIException + */ + public function suspend(Operations\SuspendAuthorRequestBody $body, string $id, ?string $projectId = null, ?Options $options = null): Operations\SuspendAuthorResponse + { + $request = new Operations\SuspendAuthorRequest( + id: $id, + body: $body, + projectId: $projectId, + ); + $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/authors/{id}/suspend', Operations\SuspendAuthorRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'body', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); + if (! array_key_exists('headers', $httpOptions)) { + $httpOptions['headers'] = []; + } + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'suspendAuthor', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + if (Utils\Utils::matchStatusCodes($httpResponse->getStatusCode(), ['4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Operations\SuspendAuthorResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\SuspendAuthorResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + object: $obj); + + return $response; + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\BadRequestError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\AuthenticationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\NotFoundError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['429'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\RateLimitError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * Unblock author + * + * Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + * + * @param \ModerationApi\Models\Operations\UnblockAuthorRequestBody $body + * @param string $id + * @param ?string $projectId + * @return \ModerationApi\Models\Operations\UnblockAuthorResponse + * @throws \ModerationApi\Models\Errors\APIException + */ + public function unblock(Operations\UnblockAuthorRequestBody $body, string $id, ?string $projectId = null, ?Options $options = null): Operations\UnblockAuthorResponse + { + $request = new Operations\UnblockAuthorRequest( + id: $id, + body: $body, + projectId: $projectId, + ); + $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/authors/{id}/unblock', Operations\UnblockAuthorRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'body', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); + if (! array_key_exists('headers', $httpOptions)) { + $httpOptions['headers'] = []; + } + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'unblockAuthor', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + if (Utils\Utils::matchStatusCodes($httpResponse->getStatusCode(), ['4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Operations\UnblockAuthorResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\UnblockAuthorResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + object: $obj); + + return $response; + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\BadRequestError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\AuthenticationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\NotFoundError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['429'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\RateLimitError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + /** * Update author details * diff --git a/src/Content.php b/src/Content.php index 8af6896..e8b0267 100644 --- a/src/Content.php +++ b/src/Content.php @@ -44,6 +44,258 @@ public function getUrl(string $baseUrl, array $urlVariables): string return Utils\Utils::templateUrl($baseUrl, $urlVariables); } + /** + * Allow content + * + * Allow a content item with the built-in allow action, and resolve it in the review queue. + * + * @param \ModerationApi\Models\Operations\AllowContentRequestBody $body + * @param string $id + * @param ?string $projectId + * @return \ModerationApi\Models\Operations\AllowContentResponse + * @throws \ModerationApi\Models\Errors\APIException + */ + public function allow(Operations\AllowContentRequestBody $body, string $id, ?string $projectId = null, ?Options $options = null): Operations\AllowContentResponse + { + $request = new Operations\AllowContentRequest( + id: $id, + body: $body, + projectId: $projectId, + ); + $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/content/{id}/allow', Operations\AllowContentRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'body', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); + if (! array_key_exists('headers', $httpOptions)) { + $httpOptions['headers'] = []; + } + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'allowContent', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + if (Utils\Utils::matchStatusCodes($httpResponse->getStatusCode(), ['4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Operations\AllowContentResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\AllowContentResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + object: $obj); + + return $response; + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\BadRequestError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\AuthenticationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\NotFoundError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['429'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\RateLimitError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * Reject content + * + * Reject a content item with the built-in reject action, and resolve it in the review queue. + * + * @param \ModerationApi\Models\Operations\RejectContentRequestBody $body + * @param string $id + * @param ?string $projectId + * @return \ModerationApi\Models\Operations\RejectContentResponse + * @throws \ModerationApi\Models\Errors\APIException + */ + public function reject(Operations\RejectContentRequestBody $body, string $id, ?string $projectId = null, ?Options $options = null): Operations\RejectContentResponse + { + $request = new Operations\RejectContentRequest( + id: $id, + body: $body, + projectId: $projectId, + ); + $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/content/{id}/reject', Operations\RejectContentRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'body', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); + if (! array_key_exists('headers', $httpOptions)) { + $httpOptions['headers'] = []; + } + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'rejectContent', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + if (Utils\Utils::matchStatusCodes($httpResponse->getStatusCode(), ['4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Operations\RejectContentResponseBody', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\RejectContentResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + object: $obj); + + return $response; + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\BadRequestError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\AuthenticationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\NotFoundError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['429'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\ModerationApi\Models\Errors\RateLimitError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $obj->rawResponse = $httpResponse; + throw $obj->toException(); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \ModerationApi\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \ModerationApi\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + /** * Submit content * diff --git a/src/Models/Operations/AllowContentRequest.php b/src/Models/Operations/AllowContentRequest.php new file mode 100644 index 0000000..d1a100f --- /dev/null +++ b/src/Models/Operations/AllowContentRequest.php @@ -0,0 +1,49 @@ +id = $id; + $this->body = $body; + $this->projectId = $projectId; + } +} \ No newline at end of file diff --git a/src/Models/Operations/AllowContentRequestBody.php b/src/Models/Operations/AllowContentRequestBody.php new file mode 100644 index 0000000..dd1ea44 --- /dev/null +++ b/src/Models/Operations/AllowContentRequestBody.php @@ -0,0 +1,64 @@ +reason = $reason; + $this->queueId = $queueId; + $this->moderator = $moderator; + $this->createCasebookCase = $createCasebookCase; + } +} \ No newline at end of file diff --git a/src/Models/Operations/AllowContentResponse.php b/src/Models/Operations/AllowContentResponse.php new file mode 100644 index 0000000..b91c2d7 --- /dev/null +++ b/src/Models/Operations/AllowContentResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->object = $object; + } +} \ No newline at end of file diff --git a/src/Models/Operations/AllowContentResponseBody.php b/src/Models/Operations/AllowContentResponseBody.php new file mode 100644 index 0000000..5fd4f91 --- /dev/null +++ b/src/Models/Operations/AllowContentResponseBody.php @@ -0,0 +1,31 @@ +success = $success; + } +} \ No newline at end of file diff --git a/src/Models/Operations/BlockAuthorRequest.php b/src/Models/Operations/BlockAuthorRequest.php new file mode 100644 index 0000000..e3b1aa1 --- /dev/null +++ b/src/Models/Operations/BlockAuthorRequest.php @@ -0,0 +1,49 @@ +id = $id; + $this->body = $body; + $this->projectId = $projectId; + } +} \ No newline at end of file diff --git a/src/Models/Operations/BlockAuthorRequestBody.php b/src/Models/Operations/BlockAuthorRequestBody.php new file mode 100644 index 0000000..1e3578f --- /dev/null +++ b/src/Models/Operations/BlockAuthorRequestBody.php @@ -0,0 +1,31 @@ +reason = $reason; + } +} \ No newline at end of file diff --git a/src/Models/Operations/BlockAuthorResponse.php b/src/Models/Operations/BlockAuthorResponse.php new file mode 100644 index 0000000..0b72778 --- /dev/null +++ b/src/Models/Operations/BlockAuthorResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->object = $object; + } +} \ No newline at end of file diff --git a/src/Models/Operations/BlockAuthorResponseBody.php b/src/Models/Operations/BlockAuthorResponseBody.php new file mode 100644 index 0000000..7b84e12 --- /dev/null +++ b/src/Models/Operations/BlockAuthorResponseBody.php @@ -0,0 +1,31 @@ +success = $success; + } +} \ No newline at end of file diff --git a/src/Models/Operations/ExecuteActionRequestBody.php b/src/Models/Operations/ExecuteActionRequestBody.php index 642198c..0f7b4b4 100644 --- a/src/Models/Operations/ExecuteActionRequestBody.php +++ b/src/Models/Operations/ExecuteActionRequestBody.php @@ -67,6 +67,24 @@ class ExecuteActionRequestBody #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?float $duration = null; + /** + * The user ID or email of the organization member who made the decision. The action is recorded as theirs. + * + * @var ?string $moderator + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('moderator')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $moderator = null; + + /** + * Record an allow or reject decision as a casebook case. Defaults to true when `moderator` is set, else false. Without `moderator`, the case is recorded as System. + * + * @var ?bool $createCasebookCase + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createCasebookCase')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $createCasebookCase = null; + /** * @param string $actionKey * @param ?array $contentIds @@ -74,9 +92,11 @@ class ExecuteActionRequestBody * @param ?string $value * @param ?string $queueId * @param ?float $duration + * @param ?string $moderator + * @param ?bool $createCasebookCase * @phpstan-pure */ - public function __construct(string $actionKey, ?array $contentIds = null, ?array $authorIds = null, ?string $value = null, ?string $queueId = null, ?float $duration = null) + public function __construct(string $actionKey, ?array $contentIds = null, ?array $authorIds = null, ?string $value = null, ?string $queueId = null, ?float $duration = null, ?string $moderator = null, ?bool $createCasebookCase = null) { $this->actionKey = $actionKey; $this->contentIds = $contentIds; @@ -84,5 +104,7 @@ public function __construct(string $actionKey, ?array $contentIds = null, ?array $this->value = $value; $this->queueId = $queueId; $this->duration = $duration; + $this->moderator = $moderator; + $this->createCasebookCase = $createCasebookCase; } } \ No newline at end of file diff --git a/src/Models/Operations/RejectContentRequest.php b/src/Models/Operations/RejectContentRequest.php new file mode 100644 index 0000000..ef48e66 --- /dev/null +++ b/src/Models/Operations/RejectContentRequest.php @@ -0,0 +1,49 @@ +id = $id; + $this->body = $body; + $this->projectId = $projectId; + } +} \ No newline at end of file diff --git a/src/Models/Operations/RejectContentRequestBody.php b/src/Models/Operations/RejectContentRequestBody.php new file mode 100644 index 0000000..b925d35 --- /dev/null +++ b/src/Models/Operations/RejectContentRequestBody.php @@ -0,0 +1,64 @@ +reason = $reason; + $this->queueId = $queueId; + $this->moderator = $moderator; + $this->createCasebookCase = $createCasebookCase; + } +} \ No newline at end of file diff --git a/src/Models/Operations/RejectContentResponse.php b/src/Models/Operations/RejectContentResponse.php new file mode 100644 index 0000000..bc6d601 --- /dev/null +++ b/src/Models/Operations/RejectContentResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->object = $object; + } +} \ No newline at end of file diff --git a/src/Models/Operations/RejectContentResponseBody.php b/src/Models/Operations/RejectContentResponseBody.php new file mode 100644 index 0000000..ae9210b --- /dev/null +++ b/src/Models/Operations/RejectContentResponseBody.php @@ -0,0 +1,31 @@ +success = $success; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SuspendAuthorRequest.php b/src/Models/Operations/SuspendAuthorRequest.php new file mode 100644 index 0000000..b325789 --- /dev/null +++ b/src/Models/Operations/SuspendAuthorRequest.php @@ -0,0 +1,49 @@ +id = $id; + $this->body = $body; + $this->projectId = $projectId; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SuspendAuthorRequestBody.php b/src/Models/Operations/SuspendAuthorRequestBody.php new file mode 100644 index 0000000..93569d9 --- /dev/null +++ b/src/Models/Operations/SuspendAuthorRequestBody.php @@ -0,0 +1,42 @@ +reason = $reason; + $this->duration = $duration; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SuspendAuthorResponse.php b/src/Models/Operations/SuspendAuthorResponse.php new file mode 100644 index 0000000..0e7e280 --- /dev/null +++ b/src/Models/Operations/SuspendAuthorResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->object = $object; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SuspendAuthorResponseBody.php b/src/Models/Operations/SuspendAuthorResponseBody.php new file mode 100644 index 0000000..7f91c84 --- /dev/null +++ b/src/Models/Operations/SuspendAuthorResponseBody.php @@ -0,0 +1,31 @@ +success = $success; + } +} \ No newline at end of file diff --git a/src/Models/Operations/UnblockAuthorRequest.php b/src/Models/Operations/UnblockAuthorRequest.php new file mode 100644 index 0000000..85b4015 --- /dev/null +++ b/src/Models/Operations/UnblockAuthorRequest.php @@ -0,0 +1,49 @@ +id = $id; + $this->body = $body; + $this->projectId = $projectId; + } +} \ No newline at end of file diff --git a/src/Models/Operations/UnblockAuthorRequestBody.php b/src/Models/Operations/UnblockAuthorRequestBody.php new file mode 100644 index 0000000..9e841c2 --- /dev/null +++ b/src/Models/Operations/UnblockAuthorRequestBody.php @@ -0,0 +1,31 @@ +reason = $reason; + } +} \ No newline at end of file diff --git a/src/Models/Operations/UnblockAuthorResponse.php b/src/Models/Operations/UnblockAuthorResponse.php new file mode 100644 index 0000000..8418fe5 --- /dev/null +++ b/src/Models/Operations/UnblockAuthorResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->object = $object; + } +} \ No newline at end of file diff --git a/src/Models/Operations/UnblockAuthorResponseBody.php b/src/Models/Operations/UnblockAuthorResponseBody.php new file mode 100644 index 0000000..7f17784 --- /dev/null +++ b/src/Models/Operations/UnblockAuthorResponseBody.php @@ -0,0 +1,31 @@ +success = $success; + } +} \ No newline at end of file diff --git a/src/ModerationApi.php b/src/ModerationApi.php index 7c60cd1..22f76f3 100644 --- a/src/ModerationApi.php +++ b/src/ModerationApi.php @@ -33,6 +33,8 @@ class ModerationApi public Actions $actions; + public Content $content; + public Webhooks $webhooks; public WebhookSecret $webhookSecret; @@ -41,8 +43,6 @@ class ModerationApi public Wordlist $wordlist; - public Content $content; - public Projects $projects; public Channels $channels; @@ -68,11 +68,11 @@ public function __construct( $this->feedback = new Feedback($this->sdkConfiguration); $this->queue = new Queue($this->sdkConfiguration); $this->actions = new Actions($this->sdkConfiguration); + $this->content = new Content($this->sdkConfiguration); $this->webhooks = new Webhooks($this->sdkConfiguration); $this->webhookSecret = new WebhookSecret($this->sdkConfiguration); $this->account = new Account($this->sdkConfiguration); $this->wordlist = new Wordlist($this->sdkConfiguration); - $this->content = new Content($this->sdkConfiguration); $this->projects = new Projects($this->sdkConfiguration); $this->channels = new Channels($this->sdkConfiguration); $this->initHooks(); diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index a55fb60..c60625c 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -26,11 +26,11 @@ class SDKConfiguration public string $openapiDocVersion = '1.1.0'; - public string $sdkVersion = '1.2.0'; + public string $sdkVersion = '1.3.0'; public string $genVersion = 'internal'; - public string $userAgent = 'speakeasy-sdk/php 1.2.0 internal 1.1.0 moderation-api/sdk-php'; + public string $userAgent = 'speakeasy-sdk/php 1.3.0 internal 1.1.0 moderation-api/sdk-php'; public ?RetryConfig $retryConfig = null;