diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 7f291efc..a4cf2586 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: a78f35a2-6d8d-4b9f-8962-89b8103f2924 management: - docChecksum: ed2fd953cba3e99fb81365252925a0d4 + docChecksum: d6bce8a263f0ec11d54bdf026957ba2f docVersion: 1.1.0 speakeasyVersion: internal generationVersion: internal - releaseVersion: 3.2.0 - configChecksum: 0d197436b8968818862fd1ec6291022b + releaseVersion: 3.3.0 + configChecksum: f643d19c39f460f5b897b686b9f50d2e repoURL: https://github.com/moderation-api/sdk-ruby installationURL: https://github.com/moderation-api/sdk-ruby published: true @@ -38,7 +38,7 @@ trackedFiles: Gemfile: last_write_checksum: sha1:8c1b6fa9505f61abd0fb6741f8094e9655a55495 Gemfile.lock: - last_write_checksum: sha1:2c3d61f3767431df09409eb83c03b5d10688ab22 + last_write_checksum: sha1:6e10344330d556edc920935336fa64f52bda4df7 Rakefile: last_write_checksum: sha1:c572639efdae8c7b24141ee5c02d8f009e101ed8 USAGE.md: @@ -165,6 +165,14 @@ trackedFiles: last_write_checksum: sha1:969a12c5fdfb0b1b78abe63361e1fa1628e4fc26 docs/models/operations/alcohol.md: last_write_checksum: sha1:2543c55aacd828f37e5d0696b7f8a7c76fe11ace + docs/models/operations/allowcontentrequest.md: + last_write_checksum: sha1:7d8ef2efaa5ca546f59b7f512d15fe8d5be84a68 + docs/models/operations/allowcontentrequestbody.md: + last_write_checksum: sha1:f360e703396a76e1088c44bbc69f6995fabe4230 + docs/models/operations/allowcontentresponse.md: + last_write_checksum: sha1:64b8c5b136755285be0f9d09b9e53736a7f200cb + docs/models/operations/allowcontentresponsebody.md: + last_write_checksum: sha1:79148067391a6482ba7a57c129e294baff33565d docs/models/operations/audiorequest.md: last_write_checksum: sha1:a6eae479403113a3826b970f5623555a1e5ecbe7 docs/models/operations/audioresponse.md: @@ -175,6 +183,14 @@ trackedFiles: last_write_checksum: sha1:7d59dfb7d20044f836c22c10727f7766cf9e81b8 docs/models/operations/block.md: last_write_checksum: sha1:85e7f9959076166397c429e3ad1b86f11e5f84e0 + docs/models/operations/blockauthorrequest.md: + last_write_checksum: sha1:2bc4610a2e41080670d0f1676d6de13144bd183f + docs/models/operations/blockauthorrequestbody.md: + last_write_checksum: sha1:a368f9dbf13d9ea7a91cc087ed34d7313eafcc02 + docs/models/operations/blockauthorresponse.md: + last_write_checksum: sha1:e225349fc3a69e079af18cce63fc52c4790ede3b + docs/models/operations/blockauthorresponsebody.md: + last_write_checksum: sha1:4e3a7b7b72d4c417d645f9b61ba11c222a6be82d docs/models/operations/brandimpersonation.md: last_write_checksum: sha1:d499d8bbab4a265e56c70f2029d7abb956f44246 docs/models/operations/bucket.md: @@ -360,7 +376,7 @@ trackedFiles: docs/models/operations/executeactionrequest.md: last_write_checksum: sha1:e3e8882f31cf89a48dfc71153757dd9dc5f7f3c5 docs/models/operations/executeactionrequestbody.md: - last_write_checksum: sha1:f5f76dfd308978b06c0afbaa7fcc71ab9f6b98cc + last_write_checksum: sha1:1b83f563d25735196fb00fbf7a227a0cda3586ba docs/models/operations/executeactionresponse.md: last_write_checksum: sha1:7f09f76bb4556f2710c60479a59f18b24c0c3671 docs/models/operations/executeactionresponsebody.md: @@ -647,6 +663,14 @@ trackedFiles: last_write_checksum: sha1:9b2f9fe2aafa6b75258e9ae6f3a474f0e32cd2f0 docs/models/operations/recommendation.md: last_write_checksum: sha1:7231d6311be79410b5fc5fd8e5a7277ea6a1086c + docs/models/operations/rejectcontentrequest.md: + last_write_checksum: sha1:1896b7ba9e6fef0df2a94d7fa30bd3d9b512c8a7 + docs/models/operations/rejectcontentrequestbody.md: + last_write_checksum: sha1:231f642cba2c0690600705a77cae93dd8dfd5cd3 + docs/models/operations/rejectcontentresponse.md: + last_write_checksum: sha1:cfd32ebc8300ae105fedbe2ab2220787a8c135da + docs/models/operations/rejectcontentresponsebody.md: + last_write_checksum: sha1:803a9023db2246f13a7a616272f84b73b53c60fc docs/models/operations/religion.md: last_write_checksum: sha1:60a7524aee8d44058881d8a10476e8ba57c7d461 docs/models/operations/removewordlistwordsrequest.md: @@ -715,6 +739,14 @@ trackedFiles: last_write_checksum: sha1:c7f8c3160bb9f0334022cd29f35780cada7e2a22 docs/models/operations/submitcontentresponsebody.md: last_write_checksum: sha1:3150c95ae933694ca052c336fa7eb7ed9dbeb404 + docs/models/operations/suspendauthorrequest.md: + last_write_checksum: sha1:139cb7914ece6613d0324715d3617b0612d8377a + docs/models/operations/suspendauthorrequestbody.md: + last_write_checksum: sha1:98c0180e9c225f4f77842f412695d2c977b300c9 + docs/models/operations/suspendauthorresponse.md: + last_write_checksum: sha1:4e4ee8570c6da2a5660d0f3b9f63d78c6aad2f48 + docs/models/operations/suspendauthorresponsebody.md: + last_write_checksum: sha1:80ba580addfc7f8ffd00ffd920314c8912d3af4b docs/models/operations/textrequest.md: last_write_checksum: sha1:5504d33c603553cf5434bcc71ea51e6ffa339493 docs/models/operations/textresponse.md: @@ -737,6 +769,14 @@ trackedFiles: last_write_checksum: sha1:896458c2c4d6db0a02757bfe454b701ef1251f42 docs/models/operations/trustlevel.md: last_write_checksum: sha1:2c6430450c436021710ec3ceb5a9daac5add8230 + docs/models/operations/unblockauthorrequest.md: + last_write_checksum: sha1:5fab7b81bafa369b7c31206e5dbf370c1928dfcf + docs/models/operations/unblockauthorrequestbody.md: + last_write_checksum: sha1:bc507d54086dad0e114d9dbea17e6b595ca7c9a5 + docs/models/operations/unblockauthorresponse.md: + last_write_checksum: sha1:b9f3f4f20c6b8796e9501dd34dd6551ee7865f85 + docs/models/operations/unblockauthorresponsebody.md: + last_write_checksum: sha1:8b747cfe2e8ef37842c4b1d0672dd205a9bd3fd1 docs/models/operations/unicodespoofing.md: last_write_checksum: sha1:79534af1086c3960979eeadb5a132cbba08a993a docs/models/operations/unresolvequeueitemrequest.md: @@ -842,11 +882,11 @@ trackedFiles: docs/sdks/apikeys/README.md: last_write_checksum: sha1:c277df0dc195f6588c29736d6c4ee2c062a92061 docs/sdks/authors/README.md: - last_write_checksum: sha1:7800c609dcf0d08704bc564985dc5daf8b9283ad + last_write_checksum: sha1:8a28389b11c3e77f27d77a5cf26428d1253a89ec docs/sdks/channels/README.md: last_write_checksum: sha1:ed1f37cd92ff8ef60df01de8567e533f4c2adf26 docs/sdks/content/README.md: - last_write_checksum: sha1:6eb462eba4263a50a6f9f023e26f52d766dd7eba + last_write_checksum: sha1:a83d960a8c159a36fb3f99a1912dbdf346d0ad13 docs/sdks/feedback/README.md: last_write_checksum: sha1:a01d711b5e761184a0033a59f4604075be684cfb docs/sdks/items/README.md: @@ -876,7 +916,7 @@ trackedFiles: lib/crystalline/utils.rb: last_write_checksum: sha1:b32469851da6f9f729e484ade6a23b38639a652a lib/moderation_api.rb: - last_write_checksum: sha1:cc55cd355ce1b4ca083afbb3e6217ed0044ad1f7 + last_write_checksum: sha1:3c337d208b6e1ac750ea701bb0d014fe1a00fa21 lib/moderation_api/account.rb: last_write_checksum: sha1:ea3cfe55787ecb7cc8ed798b76d4036b1aa3d3bc lib/moderation_api/actions.rb: @@ -886,11 +926,11 @@ trackedFiles: lib/moderation_api/apikeys.rb: last_write_checksum: sha1:bc9c59b88e2aa7858c248ec13e4fa42569878378 lib/moderation_api/authors.rb: - last_write_checksum: sha1:0753376a42796e32cc32f15b8492a235debe8a21 + last_write_checksum: sha1:cfd86b92eb9ff40dc3c057c558a17186829f8686 lib/moderation_api/channels.rb: last_write_checksum: sha1:8d995eac91d890d34e95f9c6120c503337bda145 lib/moderation_api/content.rb: - last_write_checksum: sha1:f167674cc2738936de6ea0d3d2da6a9bf76cf918 + last_write_checksum: sha1:3bb7a2028db1c2e83b3e66f428e4ded4c7f5a9bc lib/moderation_api/feedback.rb: last_write_checksum: sha1:184f119c5d2fc1bcb5f65416c2d61ae445759303 lib/moderation_api/items.rb: @@ -1118,7 +1158,7 @@ trackedFiles: lib/moderation_api/models/errors/ratelimiterror.rbi: last_write_checksum: sha1:87922693e4ec7f67110e261b50d041d6591d3a6b lib/moderation_api/models/operations.rb: - last_write_checksum: sha1:2f5aa99b821bb90b2a263a3b518b17db90ee984e + last_write_checksum: sha1:2d68be2cd15f38a13613397ed812fad2c5472039 lib/moderation_api/models/operations/action_request.rb: last_write_checksum: sha1:dfab71edc86fbc3977a4b8a8a5b781c24536b087 lib/moderation_api/models/operations/action_request.rbi: @@ -1151,6 +1191,22 @@ trackedFiles: last_write_checksum: sha1:f7c82df8e8e3c6b6133dd498f154b8ed1eb017d8 lib/moderation_api/models/operations/alcohol.rbi: last_write_checksum: sha1:a18912c78aa45cd1816f1f671a613a36ccc28ede + lib/moderation_api/models/operations/allowcontent_request.rb: + last_write_checksum: sha1:8199ae0e3d00ba0b24e0a43bb1aa09b397c583f4 + lib/moderation_api/models/operations/allowcontent_request.rbi: + last_write_checksum: sha1:3742af0ff2b0a2d9f420e138688aa76f7facd9f6 + lib/moderation_api/models/operations/allowcontent_requestbody.rb: + last_write_checksum: sha1:06ae0f58f2b8d49984f26f94d1433b2a94c7469d + lib/moderation_api/models/operations/allowcontent_requestbody.rbi: + last_write_checksum: sha1:e69dded6e686e5969a39d40fbc5f6ebcaf6241ef + lib/moderation_api/models/operations/allowcontent_response.rb: + last_write_checksum: sha1:e68bc46e71302fefe3beb8a7e1716ceca5264d32 + lib/moderation_api/models/operations/allowcontent_response.rbi: + last_write_checksum: sha1:4fb5b123546d43a758da8db1b1651dbe9ade660e + lib/moderation_api/models/operations/allowcontent_responsebody.rb: + last_write_checksum: sha1:bda18a9068fb4cb8065364fcec546696a7c7c726 + lib/moderation_api/models/operations/allowcontent_responsebody.rbi: + last_write_checksum: sha1:7870071fdf5b5c9288b06964f0938a31ed7999d6 lib/moderation_api/models/operations/audio_request.rb: last_write_checksum: sha1:8b07425430cd7bd96317e68130d28b8e8b07d422 lib/moderation_api/models/operations/audio_request.rbi: @@ -1171,6 +1227,22 @@ trackedFiles: last_write_checksum: sha1:0db271858041f1d44b1ec1b86ad160ebe9492141 lib/moderation_api/models/operations/block.rbi: last_write_checksum: sha1:20f7fb992b0329290177fe82792568f5642b4614 + lib/moderation_api/models/operations/blockauthor_request.rb: + last_write_checksum: sha1:cc635efbe530baead1710ba0bc80d02b428c80b1 + lib/moderation_api/models/operations/blockauthor_request.rbi: + last_write_checksum: sha1:9827259d4bd10003425af14c1a742bcceadffff6 + lib/moderation_api/models/operations/blockauthor_requestbody.rb: + last_write_checksum: sha1:ad3d2ca8d8c40174ce2b3e6e3ede00eb00d90a22 + lib/moderation_api/models/operations/blockauthor_requestbody.rbi: + last_write_checksum: sha1:b09921f73d3864eecdece5b1059e810333765707 + lib/moderation_api/models/operations/blockauthor_response.rb: + last_write_checksum: sha1:e47ce98d8aa44aa9177cd798eec2c965d7f88af2 + lib/moderation_api/models/operations/blockauthor_response.rbi: + last_write_checksum: sha1:1386f16668d50b9c933fc24108029db83fd76d5f + lib/moderation_api/models/operations/blockauthor_responsebody.rb: + last_write_checksum: sha1:694a21b3eac61c52a9a5b142054bc8ffeb2e81cd + lib/moderation_api/models/operations/blockauthor_responsebody.rbi: + last_write_checksum: sha1:6af16e8ac0452ee286544fb0c9a70e30f8b6c12e lib/moderation_api/models/operations/brand_impersonation.rb: last_write_checksum: sha1:987e096717f8ea05b9f81c72cb98106c88d5580d lib/moderation_api/models/operations/brand_impersonation.rbi: @@ -1540,9 +1612,9 @@ trackedFiles: lib/moderation_api/models/operations/executeaction_request.rbi: last_write_checksum: sha1:42184359c803c8c4b96ced107032b9c114ab4712 lib/moderation_api/models/operations/executeaction_requestbody.rb: - last_write_checksum: sha1:4b49ead8234cc17e317fdfcc3667bf7f469e093c + last_write_checksum: sha1:413e5bd15e0dfe36d39004d0640264bbe1dcd0a8 lib/moderation_api/models/operations/executeaction_requestbody.rbi: - last_write_checksum: sha1:e742bb1d237260f36f8b2b3b5006a9763c766733 + last_write_checksum: sha1:e398561a1cbd94ab49aebef173b0a7c14df3d1cd lib/moderation_api/models/operations/executeaction_response.rb: last_write_checksum: sha1:da59db1849ef77e0bf76977365fa7f09f1aba52e lib/moderation_api/models/operations/executeaction_response.rbi: @@ -2115,6 +2187,22 @@ trackedFiles: last_write_checksum: sha1:c162f92b4453f05e10e5f8cff275714bc6f390bc lib/moderation_api/models/operations/recommendation.rbi: last_write_checksum: sha1:20a88cdefbd0d8599acb625e728c9ce459fb2b27 + lib/moderation_api/models/operations/rejectcontent_request.rb: + last_write_checksum: sha1:071d46527236522ce8bbc0a92117c0772d39d149 + lib/moderation_api/models/operations/rejectcontent_request.rbi: + last_write_checksum: sha1:f2c28f403c3fc9178c82038ddfc8d2e0e8201446 + lib/moderation_api/models/operations/rejectcontent_requestbody.rb: + last_write_checksum: sha1:24ce844df5fdd36e98d27dc22871f5d83f628fba + lib/moderation_api/models/operations/rejectcontent_requestbody.rbi: + last_write_checksum: sha1:923c45d3b3ed5778caf970b53d9f1654a281f54a + lib/moderation_api/models/operations/rejectcontent_response.rb: + last_write_checksum: sha1:9dd74f63f102da4d25f75430bc40f96744bbd344 + lib/moderation_api/models/operations/rejectcontent_response.rbi: + last_write_checksum: sha1:a42b5dff3093fe5a396a490dba5aeccfb3d4ff2a + lib/moderation_api/models/operations/rejectcontent_responsebody.rb: + last_write_checksum: sha1:4bb0640d963eb7007548d8f7e04b28f5336e838f + lib/moderation_api/models/operations/rejectcontent_responsebody.rbi: + last_write_checksum: sha1:5024d752b3d8ba970be5c06e2d637b29ff895a1e lib/moderation_api/models/operations/religion.rb: last_write_checksum: sha1:f413eaedc03cf11bebefb587ffbe3e9dd4ea521e lib/moderation_api/models/operations/religion.rbi: @@ -2251,6 +2339,22 @@ trackedFiles: last_write_checksum: sha1:bd0dd24084a1a6a6ea06c84429a9fbfc306bf4a8 lib/moderation_api/models/operations/submitcontent_responsebody.rbi: last_write_checksum: sha1:e0fabb1cacec37c365400b79867ae09b48112717 + lib/moderation_api/models/operations/suspendauthor_request.rb: + last_write_checksum: sha1:ad2ed7c9a52169185b74b6e25245f8ed7cdc3172 + lib/moderation_api/models/operations/suspendauthor_request.rbi: + last_write_checksum: sha1:9b42baa394294ed3bbff16e001ebb2adfe144654 + lib/moderation_api/models/operations/suspendauthor_requestbody.rb: + last_write_checksum: sha1:7a7790dd3beac12563063e02824fb4174ae7633d + lib/moderation_api/models/operations/suspendauthor_requestbody.rbi: + last_write_checksum: sha1:532d41dcffcc126feb7a29fd0095e332cfdc734a + lib/moderation_api/models/operations/suspendauthor_response.rb: + last_write_checksum: sha1:139139572b75d8e021a2342c8f4724c236c0946d + lib/moderation_api/models/operations/suspendauthor_response.rbi: + last_write_checksum: sha1:a4c06271777241328980dd7c3644b759d5f7d794 + lib/moderation_api/models/operations/suspendauthor_responsebody.rb: + last_write_checksum: sha1:6c5d84d42fd6d4d55c5f2097324efc812b4f2f02 + lib/moderation_api/models/operations/suspendauthor_responsebody.rbi: + last_write_checksum: sha1:47c29af2904562ca979166f44ef221ed9e6efda5 lib/moderation_api/models/operations/text_request.rb: last_write_checksum: sha1:d8ca25b0e420051d42bda6bc462f628369aef3c5 lib/moderation_api/models/operations/text_request.rbi: @@ -2295,6 +2399,22 @@ trackedFiles: last_write_checksum: sha1:c059f420bb935dfe26e632b2f5d98ffb7139264b lib/moderation_api/models/operations/trust_level.rbi: last_write_checksum: sha1:851cc3b44b9bc61eefc82aa80e238a54766c3185 + lib/moderation_api/models/operations/unblockauthor_request.rb: + last_write_checksum: sha1:db00b2cb82679f24a9959c073c45abaf033ac1be + lib/moderation_api/models/operations/unblockauthor_request.rbi: + last_write_checksum: sha1:5eafc818e42d95804bbdc0d7e10cd9713155d625 + lib/moderation_api/models/operations/unblockauthor_requestbody.rb: + last_write_checksum: sha1:1eb787416705e9e5ce0989202849e917a1889a28 + lib/moderation_api/models/operations/unblockauthor_requestbody.rbi: + last_write_checksum: sha1:02e674509664c4b40d32f451c88d23a7bdea30c2 + lib/moderation_api/models/operations/unblockauthor_response.rb: + last_write_checksum: sha1:2c6c336136d3fa6bb5583a7843b2812a5f82e01e + lib/moderation_api/models/operations/unblockauthor_response.rbi: + last_write_checksum: sha1:a3cea31856e5d50141068617155fc6484eaf6c27 + lib/moderation_api/models/operations/unblockauthor_responsebody.rb: + last_write_checksum: sha1:7bf9f60245e39bdbd0cbf131b378d405c12e8722 + lib/moderation_api/models/operations/unblockauthor_responsebody.rbi: + last_write_checksum: sha1:d4c3f778a488c456376e95499608a2cd231c7b0a lib/moderation_api/models/operations/unicode_spoofing.rb: last_write_checksum: sha1:0727fb610bfaa91f2a8dab9edc155cfd097d4a21 lib/moderation_api/models/operations/unicode_spoofing.rbi: @@ -2488,7 +2608,7 @@ trackedFiles: lib/moderation_api/models/operations/weapons.rbi: last_write_checksum: sha1:4364de74124b139535fb707c2adc59b643a8aa40 lib/moderation_api/moderationapi.rb: - last_write_checksum: sha1:d5e263282892850a609fae581962e68453b55f40 + last_write_checksum: sha1:fe5a892bf05d33e92c5ec576208dd8ee01568038 lib/moderation_api/projects.rb: last_write_checksum: sha1:6f991dc6452fc24dc62a44eab0278bf9d55a7c11 lib/moderation_api/queue.rb: @@ -2498,7 +2618,7 @@ trackedFiles: lib/moderation_api/sdk_hooks/types.rb: last_write_checksum: sha1:4c965332c50ba795946cf8df50a6202e89db0a45 lib/moderation_api/sdkconfiguration.rb: - last_write_checksum: sha1:f829e80250eee5e239bf0c6d532e68250d34410a + last_write_checksum: sha1:80368426dbf67637927adc40f84b77e1ee1d2aa4 lib/moderation_api/sdkconfiguration.rbi: last_write_checksum: sha1:0ff7c53716ae2b6668c84ad4f83b9a8697482c33 lib/moderation_api/utils/forms.rb: @@ -2526,7 +2646,7 @@ trackedFiles: lib/moderation_api/words.rb: last_write_checksum: sha1:1caff3b1db9983d6cd6d76e0f90d47a39e376842 moderation_api.gemspec: - last_write_checksum: sha1:81aef4cf4776d475b8ceb30d30c84428286a8360 + last_write_checksum: sha1:06d86939c2481dab45a58511862ea78f38c7df98 sorbet/config: last_write_checksum: sha1:d02b32628dad70edc5929a9b9801d5e2dca15d40 sorbet/rbi/annotations/.gitattributes: @@ -3496,4 +3616,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 c78deec4..48b05302 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false ruby: - version: 3.2.0 + version: 3.3.0 additionalDependencies: development: {} runtime: {} diff --git a/.speakeasy/openapi.json b/.speakeasy/openapi.json index cabb255c..9a2cf7e4 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 221e7339..ff3a8417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 3.3.0 (2026-10-28) + +Full Changelog: [v3.2.0...v3.3.0](https://github.com/moderation-api/sdk-ruby/compare/v3.2.0...v3.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 + ## 3.2.0 (2026-10-26) Full Changelog: [v3.1.1...v3.2.0](https://github.com/moderation-api/sdk-ruby/compare/v3.1.1...v3.2.0) diff --git a/Gemfile.lock b/Gemfile.lock index 3aa290b4..b99020ff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - moderation_api (3.2.0) + moderation_api (3.3.0) faraday faraday-multipart faraday-retry diff --git a/README.md b/README.md index 8f30aa79..94793b66 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,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) @@ -282,6 +285,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 00000000..2b2e473c --- /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. | +| `project_id` | *T.nilable(::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` | [Models::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 00000000..4e6b7730 --- /dev/null +++ b/docs/models/operations/allowcontentrequestbody.md @@ -0,0 +1,11 @@ +# AllowContentRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reason` | *T.nilable(::String)* | :heavy_minus_sign: | Why the action was taken. Saved with the action and sent in the webhook event. | +| `queue_id` | *T.nilable(::String)* | :heavy_minus_sign: | The queue the content is reviewed in. Defaults to the project's default queue. | +| `moderator` | *T.nilable(::String)* | :heavy_minus_sign: | The user ID or email of the organization member who made the decision. The action is recorded as theirs. | +| `create_casebook_case` | *T.nilable(T::Boolean)* | :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 00000000..3567ce3a --- /dev/null +++ b/docs/models/operations/allowcontentresponse.md @@ -0,0 +1,11 @@ +# AllowContentResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::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 00000000..fe3d20ea --- /dev/null +++ b/docs/models/operations/allowcontentresponsebody.md @@ -0,0 +1,10 @@ +# AllowContentResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *T::Boolean* | :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 00000000..9a5a7f2d --- /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. | +| `project_id` | *T.nilable(::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` | [Models::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 00000000..a4693f63 --- /dev/null +++ b/docs/models/operations/blockauthorrequestbody.md @@ -0,0 +1,8 @@ +# BlockAuthorRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `reason` | *T.nilable(::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 00000000..f647beed --- /dev/null +++ b/docs/models/operations/blockauthorresponse.md @@ -0,0 +1,11 @@ +# BlockAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::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 00000000..07af08ff --- /dev/null +++ b/docs/models/operations/blockauthorresponsebody.md @@ -0,0 +1,10 @@ +# BlockAuthorResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *T::Boolean* | :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 65e454b6..464a2da7 100644 --- a/docs/models/operations/executeactionrequestbody.md +++ b/docs/models/operations/executeactionrequestbody.md @@ -5,11 +5,13 @@ Input parameters ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `action_key` | *::String* | :heavy_check_mark: | ID or key of the action to execute | -| `content_ids` | T::Array<*::String*> | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | -| `author_ids` | T::Array<*::String*> | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | -| `value` | *T.nilable(::String)* | :heavy_minus_sign: | Optional value to provide with the action | -| `queue_id` | *T.nilable(::String)* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | -| `duration` | *T.nilable(::Float)* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `action_key` | *::String* | :heavy_check_mark: | ID or key of the action to execute | +| `content_ids` | T::Array<*::String*> | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | +| `author_ids` | T::Array<*::String*> | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | +| `value` | *T.nilable(::String)* | :heavy_minus_sign: | Optional value to provide with the action | +| `queue_id` | *T.nilable(::String)* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | +| `duration` | *T.nilable(::Float)* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | +| `moderator` | *T.nilable(::String)* | :heavy_minus_sign: | The user ID or email of the organization member who made the decision. The action is recorded as theirs. | +| `create_casebook_case` | *T.nilable(T::Boolean)* | :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 00000000..77eb10c5 --- /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. | +| `project_id` | *T.nilable(::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` | [Models::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 00000000..6fa3e55b --- /dev/null +++ b/docs/models/operations/rejectcontentrequestbody.md @@ -0,0 +1,11 @@ +# RejectContentRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reason` | *T.nilable(::String)* | :heavy_minus_sign: | Why the action was taken. Saved with the action and sent in the webhook event. | +| `queue_id` | *T.nilable(::String)* | :heavy_minus_sign: | The queue the content is reviewed in. Defaults to the project's default queue. | +| `moderator` | *T.nilable(::String)* | :heavy_minus_sign: | The user ID or email of the organization member who made the decision. The action is recorded as theirs. | +| `create_casebook_case` | *T.nilable(T::Boolean)* | :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 00000000..4048d9e3 --- /dev/null +++ b/docs/models/operations/rejectcontentresponse.md @@ -0,0 +1,11 @@ +# RejectContentResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::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 00000000..27fd43c3 --- /dev/null +++ b/docs/models/operations/rejectcontentresponsebody.md @@ -0,0 +1,10 @@ +# RejectContentResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *T::Boolean* | :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 00000000..bacf6b8e --- /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. | +| `project_id` | *T.nilable(::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` | [Models::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 00000000..f209b897 --- /dev/null +++ b/docs/models/operations/suspendauthorrequestbody.md @@ -0,0 +1,9 @@ +# SuspendAuthorRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `reason` | *T.nilable(::String)* | :heavy_minus_sign: | Why the action was taken. Saved with the action and sent in the webhook event. | +| `duration` | *T.nilable(::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 00000000..9926d414 --- /dev/null +++ b/docs/models/operations/suspendauthorresponse.md @@ -0,0 +1,11 @@ +# SuspendAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::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 00000000..8ab7039d --- /dev/null +++ b/docs/models/operations/suspendauthorresponsebody.md @@ -0,0 +1,10 @@ +# SuspendAuthorResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *T::Boolean* | :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 00000000..bc62927b --- /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. | +| `project_id` | *T.nilable(::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` | [Models::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 00000000..e3a7e29b --- /dev/null +++ b/docs/models/operations/unblockauthorrequestbody.md @@ -0,0 +1,8 @@ +# UnblockAuthorRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `reason` | *T.nilable(::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 00000000..e41706c6 --- /dev/null +++ b/docs/models/operations/unblockauthorresponse.md @@ -0,0 +1,11 @@ +# UnblockAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::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 00000000..29a6d364 --- /dev/null +++ b/docs/models/operations/unblockauthorresponsebody.md @@ -0,0 +1,10 @@ +# UnblockAuthorResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *T::Boolean* | :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 fe065d60..88533713 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 @@ -247,4 +250,139 @@ end | Models::Errors::NotFoundError | 404 | application/json | | Models::Errors::RateLimitError | 429 | application/json | | Models::Errors::InternalServerError | 500 | application/json | -| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Errors::APIError | 4XX, 5XX | \*/\* | + +## block + +Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.authors.block(id: '', body: Models::Operations::BlockAuthorRequestBody.new) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [Models::Operations::BlockAuthorRequestBody](../../models/operations/blockauthorrequestbody.md) | :heavy_check_mark: | N/A | +| `project_id` | *T.nilable(::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 + +**[T.nilable(Models::Operations::BlockAuthorResponse)](../../models/operations/blockauthorresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## suspend + +Block an author for a limited time with the built-in suspend action. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.authors.suspend(id: '', body: Models::Operations::SuspendAuthorRequestBody.new( + reason: 'Violation of community guidelines', + duration: 604_800_000.0 +)) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [Models::Operations::SuspendAuthorRequestBody](../../models/operations/suspendauthorrequestbody.md) | :heavy_check_mark: | N/A | +| `project_id` | *T.nilable(::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 + +**[T.nilable(Models::Operations::SuspendAuthorResponse)](../../models/operations/suspendauthorresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## unblock + +Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.authors.unblock(id: '', body: Models::Operations::UnblockAuthorRequestBody.new) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [Models::Operations::UnblockAuthorRequestBody](../../models/operations/unblockauthorrequestbody.md) | :heavy_check_mark: | N/A | +| `project_id` | *T.nilable(::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 + +**[T.nilable(Models::Operations::UnblockAuthorResponse)](../../models/operations/unblockauthorresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/content/README.md b/docs/sdks/content/README.md index 2b5dae12..41f698b7 100644 --- a/docs/sdks/content/README.md +++ b/docs/sdks/content/README.md @@ -4,8 +4,100 @@ ### 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 + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.content.reject(id: '', body: Models::Operations::RejectContentRequestBody.new( + reason: 'Spam' +)) + +unless res.object.nil? + # handle response +end + +``` + +### 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` | [Models::Operations::RejectContentRequestBody](../../models/operations/rejectcontentrequestbody.md) | :heavy_check_mark: | N/A | +| `project_id` | *T.nilable(::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 + +**[T.nilable(Models::Operations::RejectContentResponse)](../../models/operations/rejectcontentresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## allow + +Allow a content item with the built-in allow action, and resolve it in the review queue. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.content.allow(id: '', body: Models::Operations::AllowContentRequestBody.new) + +unless res.object.nil? + # handle response +end + +``` + +### 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` | [Models::Operations::AllowContentRequestBody](../../models/operations/allowcontentrequestbody.md) | :heavy_check_mark: | N/A | +| `project_id` | *T.nilable(::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 + +**[T.nilable(Models::Operations::AllowContentResponse)](../../models/operations/allowcontentresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + ## submit Submit content diff --git a/lib/moderation_api.rb b/lib/moderation_api.rb index 3f982e37..4d5ec937 100644 --- a/lib/moderation_api.rb +++ b/lib/moderation_api.rb @@ -11,12 +11,12 @@ module ModerationApi autoload :Queue, "moderation_api/queue" autoload :Items, "moderation_api/items" autoload :Actions, "moderation_api/actions" + autoload :Content, "moderation_api/content" autoload :Webhooks, "moderation_api/webhooks" autoload :WebhookSecret, "moderation_api/webhooksecret" autoload :Account, "moderation_api/account" autoload :Wordlist, "moderation_api/wordlist" autoload :Words, "moderation_api/words" - autoload :Content, "moderation_api/content" autoload :Projects, "moderation_api/projects" autoload :ApiKeys, "moderation_api/apikeys" autoload :Channels, "moderation_api/channels" diff --git a/lib/moderation_api/authors.rb b/lib/moderation_api/authors.rb index af4758e9..99ffb0fd 100644 --- a/lib/moderation_api/authors.rb +++ b/lib/moderation_api/authors.rb @@ -1481,5 +1481,764 @@ def delete(id:, project_id: nil, timeout_ms: nil, http_headers: nil) end end + + sig { + params( + body: Models::Operations::BlockAuthorRequestBody, + id: ::String, + project_id: T.nilable(::String), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::BlockAuthorResponse) + } + def block(body:, id:, project_id: nil, timeout_ms: nil, http_headers: nil) + # block - Block author + # Block an author with the built-in block action. A blocked author cannot post new content until unblocked. + request = Models::Operations::BlockAuthorRequest.new( + id: id, + body: body, + project_id: project_id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::BlockAuthorRequest, + base_url, + "/authors/{id}/block", + request + ) + headers = Utils.get_headers(request) + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "blockAuthor", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::BlockAuthorResponseBody) + response = Models::Operations::BlockAuthorResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::SuspendAuthorRequestBody, + id: ::String, + project_id: T.nilable(::String), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::SuspendAuthorResponse) + } + def suspend(body:, id:, project_id: nil, timeout_ms: nil, http_headers: nil) + # suspend - Suspend author + # Block an author for a limited time with the built-in suspend action. + request = Models::Operations::SuspendAuthorRequest.new( + id: id, + body: body, + project_id: project_id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::SuspendAuthorRequest, + base_url, + "/authors/{id}/suspend", + request + ) + headers = Utils.get_headers(request) + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "suspendAuthor", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::SuspendAuthorResponseBody) + response = Models::Operations::SuspendAuthorResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::UnblockAuthorRequestBody, + id: ::String, + project_id: T.nilable(::String), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::UnblockAuthorResponse) + } + def unblock(body:, id:, project_id: nil, timeout_ms: nil, http_headers: nil) + # unblock - Unblock author + # Unblock a blocked or suspended author with the built-in unblock action, so they can post new content again. + request = Models::Operations::UnblockAuthorRequest.new( + id: id, + body: body, + project_id: project_id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::UnblockAuthorRequest, + base_url, + "/authors/{id}/unblock", + request + ) + headers = Utils.get_headers(request) + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "unblockAuthor", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::UnblockAuthorResponseBody) + response = Models::Operations::UnblockAuthorResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end end end diff --git a/lib/moderation_api/content.rb b/lib/moderation_api/content.rb index 31999acc..f2fbc7bd 100644 --- a/lib/moderation_api/content.rb +++ b/lib/moderation_api/content.rb @@ -37,6 +37,512 @@ def get_url(base_url:, url_variables: nil) return Utils.template_url(base_url, url_variables) end + sig { + params( + body: Models::Operations::RejectContentRequestBody, + id: ::String, + project_id: T.nilable(::String), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::RejectContentResponse) + } + def reject(body:, id:, project_id: nil, timeout_ms: nil, http_headers: nil) + # reject - Reject content + # Reject a content item with the built-in reject action, and resolve it in the review queue. + request = Models::Operations::RejectContentRequest.new( + id: id, + body: body, + project_id: project_id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::RejectContentRequest, + base_url, + "/content/{id}/reject", + request + ) + headers = Utils.get_headers(request) + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "rejectContent", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::RejectContentResponseBody) + response = Models::Operations::RejectContentResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::AllowContentRequestBody, + id: ::String, + project_id: T.nilable(::String), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::AllowContentResponse) + } + def allow(body:, id:, project_id: nil, timeout_ms: nil, http_headers: nil) + # allow - Allow content + # Allow a content item with the built-in allow action, and resolve it in the review queue. + request = Models::Operations::AllowContentRequest.new( + id: id, + body: body, + project_id: project_id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::AllowContentRequest, + base_url, + "/content/{id}/allow", + request + ) + headers = Utils.get_headers(request) + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "allowContent", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::AllowContentResponseBody) + response = Models::Operations::AllowContentResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + sig { params( body: Models::Operations::SubmitContentRequestBody, diff --git a/lib/moderation_api/models/operations.rb b/lib/moderation_api/models/operations.rb index d091799f..0ea4a31f 100644 --- a/lib/moderation_api/models/operations.rb +++ b/lib/moderation_api/models/operations.rb @@ -71,9 +71,17 @@ module Operations autoload :AddWordlistWordsResponseBody, "moderation_api/models/operations/addwordlistwords_responsebody.rb" autoload :AddWordlistWordsRequest, "moderation_api/models/operations/addwordlistwords_request.rb" autoload :AddWordlistWordsResponse, "moderation_api/models/operations/addwordlistwords_response.rb" + autoload :AllowContentRequestBody, "moderation_api/models/operations/allowcontent_requestbody.rb" + autoload :AllowContentResponseBody, "moderation_api/models/operations/allowcontent_responsebody.rb" + autoload :AllowContentRequest, "moderation_api/models/operations/allowcontent_request.rb" + autoload :AllowContentResponse, "moderation_api/models/operations/allowcontent_response.rb" autoload :AuthorStatus, "moderation_api/models/operations/author_status.rb" autoload :Behavior, "moderation_api/models/operations/behavior.rb" autoload :Block, "moderation_api/models/operations/block.rb" + autoload :BlockAuthorRequestBody, "moderation_api/models/operations/blockauthor_requestbody.rb" + autoload :BlockAuthorResponseBody, "moderation_api/models/operations/blockauthor_responsebody.rb" + autoload :BlockAuthorRequest, "moderation_api/models/operations/blockauthor_request.rb" + autoload :BlockAuthorResponse, "moderation_api/models/operations/blockauthor_response.rb" autoload :BrandImpersonation, "moderation_api/models/operations/brand_impersonation.rb" autoload :Bucket, "moderation_api/models/operations/bucket.rb" autoload :Casebook, "moderation_api/models/operations/casebook.rb" @@ -342,6 +350,10 @@ module Operations autoload :ReasonCode, "moderation_api/models/operations/reason_code.rb" autoload :ReasonCodeEnum, "moderation_api/models/operations/reason_code_enum.rb" autoload :Recommendation, "moderation_api/models/operations/recommendation.rb" + autoload :RejectContentRequestBody, "moderation_api/models/operations/rejectcontent_requestbody.rb" + autoload :RejectContentResponseBody, "moderation_api/models/operations/rejectcontent_responsebody.rb" + autoload :RejectContentRequest, "moderation_api/models/operations/rejectcontent_request.rb" + autoload :RejectContentResponse, "moderation_api/models/operations/rejectcontent_response.rb" autoload :RemoveWordlistWordsResponseBody, "moderation_api/models/operations/removewordlistwords_responsebody.rb" autoload :RemoveWordlistWordsRequest, "moderation_api/models/operations/removewordlistwords_request.rb" autoload :RemoveWordlistWordsResponse, "moderation_api/models/operations/removewordlistwords_response.rb" @@ -367,12 +379,20 @@ module Operations autoload :SubmitContentPolicyResponse, "moderation_api/models/operations/submitcontent_policy_response.rb" autoload :SubmitContentRequest, "moderation_api/models/operations/submitcontent_request.rb" autoload :SubmitContentResponse, "moderation_api/models/operations/submitcontent_response.rb" + autoload :SuspendAuthorRequestBody, "moderation_api/models/operations/suspendauthor_requestbody.rb" + autoload :SuspendAuthorResponseBody, "moderation_api/models/operations/suspendauthor_responsebody.rb" + autoload :SuspendAuthorRequest, "moderation_api/models/operations/suspendauthor_request.rb" + autoload :SuspendAuthorResponse, "moderation_api/models/operations/suspendauthor_response.rb" autoload :TopReviewer, "moderation_api/models/operations/topreviewer.rb" autoload :Topic, "moderation_api/models/operations/topic.rb" autoload :Totals, "moderation_api/models/operations/totals.rb" autoload :TranscriptionQuality, "moderation_api/models/operations/transcriptionquality.rb" autoload :Trends, "moderation_api/models/operations/trends.rb" autoload :TrustLevel, "moderation_api/models/operations/trust_level.rb" + autoload :UnblockAuthorRequestBody, "moderation_api/models/operations/unblockauthor_requestbody.rb" + autoload :UnblockAuthorResponseBody, "moderation_api/models/operations/unblockauthor_responsebody.rb" + autoload :UnblockAuthorRequest, "moderation_api/models/operations/unblockauthor_request.rb" + autoload :UnblockAuthorResponse, "moderation_api/models/operations/unblockauthor_response.rb" autoload :UnresolveQueueItemResponseBody, "moderation_api/models/operations/unresolvequeueitem_responsebody.rb" autoload :UnresolveQueueItemRequest, "moderation_api/models/operations/unresolvequeueitem_request.rb" autoload :UnresolveQueueItemResponse, "moderation_api/models/operations/unresolvequeueitem_response.rb" diff --git a/lib/moderation_api/models/operations/allowcontent_request.rb b/lib/moderation_api/models/operations/allowcontent_request.rb new file mode 100644 index 00000000..9937b6e1 --- /dev/null +++ b/lib/moderation_api/models/operations/allowcontent_request.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class AllowContentRequest + extend T::Sig + include Crystalline::MetadataFields + + # The content ID you sent when you submitted the content, or the ID Moderation API assigned. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::AllowContentRequestBody, {'request': {'media_type': "application/json"}} + # 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. + field( + :project_id, + Crystalline::Nilable.new(::String), + {'header': {'field_name': "Project-Id", 'style': "simple", 'explode': false}} + ) + + sig { + params(id: ::String, body: Models::Operations::AllowContentRequestBody, project_id: T.nilable(::String)).void + } + def initialize(id:, body:, project_id: nil) + @id = id + @body = body + @project_id = project_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + return false unless @project_id == other.project_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/allowcontent_request.rbi b/lib/moderation_api/models/operations/allowcontent_request.rbi new file mode 100644 index 00000000..97b89acb --- /dev/null +++ b/lib/moderation_api/models/operations/allowcontent_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AllowContentRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AllowContentRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end + + def project_id + end + + def project_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/allowcontent_requestbody.rb b/lib/moderation_api/models/operations/allowcontent_requestbody.rb new file mode 100644 index 00000000..ffcc3f77 --- /dev/null +++ b/lib/moderation_api/models/operations/allowcontent_requestbody.rb @@ -0,0 +1,67 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class AllowContentRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Why the action was taken. Saved with the action and sent in the webhook event. + field( + :reason, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason")}} + ) + # The queue the content is reviewed in. Defaults to the project's default queue. + field( + :queue_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("queueId")}} + ) + # The user ID or email of the organization member who made the decision. The action is recorded as theirs. + field( + :moderator, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("moderator")}} + ) + # 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. + field( + :create_casebook_case, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createCasebookCase")}} + ) + + sig { + params( + reason: T.nilable(::String), + queue_id: T.nilable(::String), + moderator: T.nilable(::String), + create_casebook_case: T.nilable(T::Boolean) + ) + .void + } + def initialize(reason: nil, queue_id: nil, moderator: nil, create_casebook_case: nil) + @reason = reason + @queue_id = queue_id + @moderator = moderator + @create_casebook_case = create_casebook_case + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @reason == other.reason + return false unless @queue_id == other.queue_id + return false unless @moderator == other.moderator + return false unless @create_casebook_case == other.create_casebook_case + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/allowcontent_requestbody.rbi b/lib/moderation_api/models/operations/allowcontent_requestbody.rbi new file mode 100644 index 00000000..43cc9b46 --- /dev/null +++ b/lib/moderation_api/models/operations/allowcontent_requestbody.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AllowContentRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AllowContentRequestBody + def reason + end + + def reason=(str_) + end + + def queue_id + end + + def queue_id=(str_) + end + + def moderator + end + + def moderator=(str_) + end + + def create_casebook_case + end + + def create_casebook_case=(str_) + end +end diff --git a/lib/moderation_api/models/operations/allowcontent_response.rb b/lib/moderation_api/models/operations/allowcontent_response.rb new file mode 100644 index 00000000..e5663e94 --- /dev/null +++ b/lib/moderation_api/models/operations/allowcontent_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class AllowContentResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action executed successfully + field :object, Crystalline::Nilable.new(Models::Operations::AllowContentResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::AllowContentResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/allowcontent_response.rbi b/lib/moderation_api/models/operations/allowcontent_response.rbi new file mode 100644 index 00000000..99103483 --- /dev/null +++ b/lib/moderation_api/models/operations/allowcontent_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AllowContentResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AllowContentResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/allowcontent_responsebody.rb b/lib/moderation_api/models/operations/allowcontent_responsebody.rb new file mode 100644 index 00000000..f662fe7d --- /dev/null +++ b/lib/moderation_api/models/operations/allowcontent_responsebody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Execution result + class AllowContentResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the action was executed successfully + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + + sig { params(success: T::Boolean).void } + def initialize(success:) + @success = success + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/allowcontent_responsebody.rbi b/lib/moderation_api/models/operations/allowcontent_responsebody.rbi new file mode 100644 index 00000000..19e1f7d7 --- /dev/null +++ b/lib/moderation_api/models/operations/allowcontent_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AllowContentResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AllowContentResponseBody + def success + end + + def success=(str_) + end +end diff --git a/lib/moderation_api/models/operations/blockauthor_request.rb b/lib/moderation_api/models/operations/blockauthor_request.rb new file mode 100644 index 00000000..6acd52fd --- /dev/null +++ b/lib/moderation_api/models/operations/blockauthor_request.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class BlockAuthorRequest + extend T::Sig + include Crystalline::MetadataFields + + # Either external ID or the ID assigned by moderation API. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::BlockAuthorRequestBody, {'request': {'media_type': "application/json"}} + # 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. + field( + :project_id, + Crystalline::Nilable.new(::String), + {'header': {'field_name': "Project-Id", 'style': "simple", 'explode': false}} + ) + + sig { + params(id: ::String, body: Models::Operations::BlockAuthorRequestBody, project_id: T.nilable(::String)).void + } + def initialize(id:, body:, project_id: nil) + @id = id + @body = body + @project_id = project_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + return false unless @project_id == other.project_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/blockauthor_request.rbi b/lib/moderation_api/models/operations/blockauthor_request.rbi new file mode 100644 index 00000000..6e277741 --- /dev/null +++ b/lib/moderation_api/models/operations/blockauthor_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::BlockAuthorRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::BlockAuthorRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end + + def project_id + end + + def project_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/blockauthor_requestbody.rb b/lib/moderation_api/models/operations/blockauthor_requestbody.rb new file mode 100644 index 00000000..5a15f5cb --- /dev/null +++ b/lib/moderation_api/models/operations/blockauthor_requestbody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class BlockAuthorRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Why the action was taken. Saved with the action and sent in the webhook event. + field( + :reason, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason")}} + ) + + sig { params(reason: T.nilable(::String)).void } + def initialize(reason: nil) + @reason = reason + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @reason == other.reason + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/blockauthor_requestbody.rbi b/lib/moderation_api/models/operations/blockauthor_requestbody.rbi new file mode 100644 index 00000000..62e16335 --- /dev/null +++ b/lib/moderation_api/models/operations/blockauthor_requestbody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::BlockAuthorRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::BlockAuthorRequestBody + def reason + end + + def reason=(str_) + end +end diff --git a/lib/moderation_api/models/operations/blockauthor_response.rb b/lib/moderation_api/models/operations/blockauthor_response.rb new file mode 100644 index 00000000..96d708b8 --- /dev/null +++ b/lib/moderation_api/models/operations/blockauthor_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class BlockAuthorResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action executed successfully + field :object, Crystalline::Nilable.new(Models::Operations::BlockAuthorResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::BlockAuthorResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/blockauthor_response.rbi b/lib/moderation_api/models/operations/blockauthor_response.rbi new file mode 100644 index 00000000..ffe5f999 --- /dev/null +++ b/lib/moderation_api/models/operations/blockauthor_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::BlockAuthorResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::BlockAuthorResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/blockauthor_responsebody.rb b/lib/moderation_api/models/operations/blockauthor_responsebody.rb new file mode 100644 index 00000000..ce0fca9d --- /dev/null +++ b/lib/moderation_api/models/operations/blockauthor_responsebody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Execution result + class BlockAuthorResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the action was executed successfully + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + + sig { params(success: T::Boolean).void } + def initialize(success:) + @success = success + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/blockauthor_responsebody.rbi b/lib/moderation_api/models/operations/blockauthor_responsebody.rbi new file mode 100644 index 00000000..25f59c13 --- /dev/null +++ b/lib/moderation_api/models/operations/blockauthor_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::BlockAuthorResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::BlockAuthorResponseBody + def success + end + + def success=(str_) + end +end diff --git a/lib/moderation_api/models/operations/executeaction_requestbody.rb b/lib/moderation_api/models/operations/executeaction_requestbody.rb index 87942c89..16eb9a85 100644 --- a/lib/moderation_api/models/operations/executeaction_requestbody.rb +++ b/lib/moderation_api/models/operations/executeaction_requestbody.rb @@ -47,6 +47,18 @@ class ExecuteActionRequestBody Crystalline::Nilable.new(::Float), {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("duration")}} ) + # The user ID or email of the organization member who made the decision. The action is recorded as theirs. + field( + :moderator, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("moderator")}} + ) + # 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. + field( + :create_casebook_case, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createCasebookCase")}} + ) sig { params( @@ -55,17 +67,30 @@ class ExecuteActionRequestBody author_ids: T.nilable(T::Array[::String]), value: T.nilable(::String), queue_id: T.nilable(::String), - duration: T.nilable(::Float) + duration: T.nilable(::Float), + moderator: T.nilable(::String), + create_casebook_case: T.nilable(T::Boolean) ) .void } - def initialize(action_key:, content_ids: nil, author_ids: nil, value: nil, queue_id: nil, duration: nil) + def initialize( + action_key:, + content_ids: nil, + author_ids: nil, + value: nil, + queue_id: nil, + duration: nil, + moderator: nil, + create_casebook_case: nil + ) @action_key = action_key @content_ids = content_ids @author_ids = author_ids @value = value @queue_id = queue_id @duration = duration + @moderator = moderator + @create_casebook_case = create_casebook_case end sig { params(other: T.untyped).returns(T::Boolean) } @@ -77,6 +102,8 @@ def ==(other) return false unless @value == other.value return false unless @queue_id == other.queue_id return false unless @duration == other.duration + return false unless @moderator == other.moderator + return false unless @create_casebook_case == other.create_casebook_case true end end diff --git a/lib/moderation_api/models/operations/executeaction_requestbody.rbi b/lib/moderation_api/models/operations/executeaction_requestbody.rbi index 129a6323..9c65f76e 100644 --- a/lib/moderation_api/models/operations/executeaction_requestbody.rbi +++ b/lib/moderation_api/models/operations/executeaction_requestbody.rbi @@ -41,4 +41,16 @@ class ModerationApi::Models::Operations::ExecuteActionRequestBody def duration=(str_) end + + def moderator + end + + def moderator=(str_) + end + + def create_casebook_case + end + + def create_casebook_case=(str_) + end end diff --git a/lib/moderation_api/models/operations/rejectcontent_request.rb b/lib/moderation_api/models/operations/rejectcontent_request.rb new file mode 100644 index 00000000..1f0c03a5 --- /dev/null +++ b/lib/moderation_api/models/operations/rejectcontent_request.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class RejectContentRequest + extend T::Sig + include Crystalline::MetadataFields + + # The content ID you sent when you submitted the content, or the ID Moderation API assigned. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::RejectContentRequestBody, {'request': {'media_type': "application/json"}} + # 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. + field( + :project_id, + Crystalline::Nilable.new(::String), + {'header': {'field_name': "Project-Id", 'style': "simple", 'explode': false}} + ) + + sig { + params(id: ::String, body: Models::Operations::RejectContentRequestBody, project_id: T.nilable(::String)).void + } + def initialize(id:, body:, project_id: nil) + @id = id + @body = body + @project_id = project_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + return false unless @project_id == other.project_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/rejectcontent_request.rbi b/lib/moderation_api/models/operations/rejectcontent_request.rbi new file mode 100644 index 00000000..dcb21723 --- /dev/null +++ b/lib/moderation_api/models/operations/rejectcontent_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::RejectContentRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::RejectContentRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end + + def project_id + end + + def project_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/rejectcontent_requestbody.rb b/lib/moderation_api/models/operations/rejectcontent_requestbody.rb new file mode 100644 index 00000000..ef9602a0 --- /dev/null +++ b/lib/moderation_api/models/operations/rejectcontent_requestbody.rb @@ -0,0 +1,67 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class RejectContentRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Why the action was taken. Saved with the action and sent in the webhook event. + field( + :reason, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason")}} + ) + # The queue the content is reviewed in. Defaults to the project's default queue. + field( + :queue_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("queueId")}} + ) + # The user ID or email of the organization member who made the decision. The action is recorded as theirs. + field( + :moderator, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("moderator")}} + ) + # 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. + field( + :create_casebook_case, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createCasebookCase")}} + ) + + sig { + params( + reason: T.nilable(::String), + queue_id: T.nilable(::String), + moderator: T.nilable(::String), + create_casebook_case: T.nilable(T::Boolean) + ) + .void + } + def initialize(reason: nil, queue_id: nil, moderator: nil, create_casebook_case: nil) + @reason = reason + @queue_id = queue_id + @moderator = moderator + @create_casebook_case = create_casebook_case + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @reason == other.reason + return false unless @queue_id == other.queue_id + return false unless @moderator == other.moderator + return false unless @create_casebook_case == other.create_casebook_case + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/rejectcontent_requestbody.rbi b/lib/moderation_api/models/operations/rejectcontent_requestbody.rbi new file mode 100644 index 00000000..5b486fea --- /dev/null +++ b/lib/moderation_api/models/operations/rejectcontent_requestbody.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::RejectContentRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::RejectContentRequestBody + def reason + end + + def reason=(str_) + end + + def queue_id + end + + def queue_id=(str_) + end + + def moderator + end + + def moderator=(str_) + end + + def create_casebook_case + end + + def create_casebook_case=(str_) + end +end diff --git a/lib/moderation_api/models/operations/rejectcontent_response.rb b/lib/moderation_api/models/operations/rejectcontent_response.rb new file mode 100644 index 00000000..4d5416cb --- /dev/null +++ b/lib/moderation_api/models/operations/rejectcontent_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class RejectContentResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action executed successfully + field :object, Crystalline::Nilable.new(Models::Operations::RejectContentResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::RejectContentResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/rejectcontent_response.rbi b/lib/moderation_api/models/operations/rejectcontent_response.rbi new file mode 100644 index 00000000..84b8d9b6 --- /dev/null +++ b/lib/moderation_api/models/operations/rejectcontent_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::RejectContentResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::RejectContentResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/rejectcontent_responsebody.rb b/lib/moderation_api/models/operations/rejectcontent_responsebody.rb new file mode 100644 index 00000000..c8fcb182 --- /dev/null +++ b/lib/moderation_api/models/operations/rejectcontent_responsebody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Execution result + class RejectContentResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the action was executed successfully + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + + sig { params(success: T::Boolean).void } + def initialize(success:) + @success = success + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/rejectcontent_responsebody.rbi b/lib/moderation_api/models/operations/rejectcontent_responsebody.rbi new file mode 100644 index 00000000..c39178c7 --- /dev/null +++ b/lib/moderation_api/models/operations/rejectcontent_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::RejectContentResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::RejectContentResponseBody + def success + end + + def success=(str_) + end +end diff --git a/lib/moderation_api/models/operations/suspendauthor_request.rb b/lib/moderation_api/models/operations/suspendauthor_request.rb new file mode 100644 index 00000000..61aa5ded --- /dev/null +++ b/lib/moderation_api/models/operations/suspendauthor_request.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SuspendAuthorRequest + extend T::Sig + include Crystalline::MetadataFields + + # Either external ID or the ID assigned by moderation API. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::SuspendAuthorRequestBody, {'request': {'media_type': "application/json"}} + # 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. + field( + :project_id, + Crystalline::Nilable.new(::String), + {'header': {'field_name': "Project-Id", 'style': "simple", 'explode': false}} + ) + + sig { + params(id: ::String, body: Models::Operations::SuspendAuthorRequestBody, project_id: T.nilable(::String)).void + } + def initialize(id:, body:, project_id: nil) + @id = id + @body = body + @project_id = project_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + return false unless @project_id == other.project_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/suspendauthor_request.rbi b/lib/moderation_api/models/operations/suspendauthor_request.rbi new file mode 100644 index 00000000..b55642c7 --- /dev/null +++ b/lib/moderation_api/models/operations/suspendauthor_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SuspendAuthorRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SuspendAuthorRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end + + def project_id + end + + def project_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/suspendauthor_requestbody.rb b/lib/moderation_api/models/operations/suspendauthor_requestbody.rb new file mode 100644 index 00000000..53a25d2e --- /dev/null +++ b/lib/moderation_api/models/operations/suspendauthor_requestbody.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SuspendAuthorRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Why the action was taken. Saved with the action and sent in the webhook event. + field( + :reason, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason")}} + ) + # How long the suspension lasts, in milliseconds. Defaults to 24 hours. + field( + :duration, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("duration")}} + ) + + sig { params(reason: T.nilable(::String), duration: T.nilable(::Float)).void } + def initialize(reason: nil, duration: nil) + @reason = reason + @duration = duration + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @reason == other.reason + return false unless @duration == other.duration + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/suspendauthor_requestbody.rbi b/lib/moderation_api/models/operations/suspendauthor_requestbody.rbi new file mode 100644 index 00000000..6908f2ed --- /dev/null +++ b/lib/moderation_api/models/operations/suspendauthor_requestbody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SuspendAuthorRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SuspendAuthorRequestBody + def reason + end + + def reason=(str_) + end + + def duration + end + + def duration=(str_) + end +end diff --git a/lib/moderation_api/models/operations/suspendauthor_response.rb b/lib/moderation_api/models/operations/suspendauthor_response.rb new file mode 100644 index 00000000..5b937854 --- /dev/null +++ b/lib/moderation_api/models/operations/suspendauthor_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SuspendAuthorResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action executed successfully + field :object, Crystalline::Nilable.new(Models::Operations::SuspendAuthorResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::SuspendAuthorResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/suspendauthor_response.rbi b/lib/moderation_api/models/operations/suspendauthor_response.rbi new file mode 100644 index 00000000..db50ad92 --- /dev/null +++ b/lib/moderation_api/models/operations/suspendauthor_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SuspendAuthorResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SuspendAuthorResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/suspendauthor_responsebody.rb b/lib/moderation_api/models/operations/suspendauthor_responsebody.rb new file mode 100644 index 00000000..2dcb0de3 --- /dev/null +++ b/lib/moderation_api/models/operations/suspendauthor_responsebody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Execution result + class SuspendAuthorResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the action was executed successfully + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + + sig { params(success: T::Boolean).void } + def initialize(success:) + @success = success + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/suspendauthor_responsebody.rbi b/lib/moderation_api/models/operations/suspendauthor_responsebody.rbi new file mode 100644 index 00000000..98ee4879 --- /dev/null +++ b/lib/moderation_api/models/operations/suspendauthor_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SuspendAuthorResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SuspendAuthorResponseBody + def success + end + + def success=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unblockauthor_request.rb b/lib/moderation_api/models/operations/unblockauthor_request.rb new file mode 100644 index 00000000..3d978758 --- /dev/null +++ b/lib/moderation_api/models/operations/unblockauthor_request.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UnblockAuthorRequest + extend T::Sig + include Crystalline::MetadataFields + + # Either external ID or the ID assigned by moderation API. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::UnblockAuthorRequestBody, {'request': {'media_type': "application/json"}} + # 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. + field( + :project_id, + Crystalline::Nilable.new(::String), + {'header': {'field_name': "Project-Id", 'style': "simple", 'explode': false}} + ) + + sig { + params(id: ::String, body: Models::Operations::UnblockAuthorRequestBody, project_id: T.nilable(::String)).void + } + def initialize(id:, body:, project_id: nil) + @id = id + @body = body + @project_id = project_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + return false unless @project_id == other.project_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unblockauthor_request.rbi b/lib/moderation_api/models/operations/unblockauthor_request.rbi new file mode 100644 index 00000000..a9a29330 --- /dev/null +++ b/lib/moderation_api/models/operations/unblockauthor_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnblockAuthorRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnblockAuthorRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end + + def project_id + end + + def project_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unblockauthor_requestbody.rb b/lib/moderation_api/models/operations/unblockauthor_requestbody.rb new file mode 100644 index 00000000..a2a98f9c --- /dev/null +++ b/lib/moderation_api/models/operations/unblockauthor_requestbody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UnblockAuthorRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Why the action was taken. Saved with the action and sent in the webhook event. + field( + :reason, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason")}} + ) + + sig { params(reason: T.nilable(::String)).void } + def initialize(reason: nil) + @reason = reason + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @reason == other.reason + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unblockauthor_requestbody.rbi b/lib/moderation_api/models/operations/unblockauthor_requestbody.rbi new file mode 100644 index 00000000..67ee19d9 --- /dev/null +++ b/lib/moderation_api/models/operations/unblockauthor_requestbody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnblockAuthorRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnblockAuthorRequestBody + def reason + end + + def reason=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unblockauthor_response.rb b/lib/moderation_api/models/operations/unblockauthor_response.rb new file mode 100644 index 00000000..84e0bf9f --- /dev/null +++ b/lib/moderation_api/models/operations/unblockauthor_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UnblockAuthorResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action executed successfully + field :object, Crystalline::Nilable.new(Models::Operations::UnblockAuthorResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::UnblockAuthorResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unblockauthor_response.rbi b/lib/moderation_api/models/operations/unblockauthor_response.rbi new file mode 100644 index 00000000..73dd1abe --- /dev/null +++ b/lib/moderation_api/models/operations/unblockauthor_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnblockAuthorResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnblockAuthorResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unblockauthor_responsebody.rb b/lib/moderation_api/models/operations/unblockauthor_responsebody.rb new file mode 100644 index 00000000..9f09be1a --- /dev/null +++ b/lib/moderation_api/models/operations/unblockauthor_responsebody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Execution result + class UnblockAuthorResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the action was executed successfully + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + + sig { params(success: T::Boolean).void } + def initialize(success:) + @success = success + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unblockauthor_responsebody.rbi b/lib/moderation_api/models/operations/unblockauthor_responsebody.rbi new file mode 100644 index 00000000..93f1d331 --- /dev/null +++ b/lib/moderation_api/models/operations/unblockauthor_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnblockAuthorResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnblockAuthorResponseBody + def success + end + + def success=(str_) + end +end diff --git a/lib/moderation_api/moderationapi.rb b/lib/moderation_api/moderationapi.rb index b6244382..4aeee65d 100644 --- a/lib/moderation_api/moderationapi.rb +++ b/lib/moderation_api/moderationapi.rb @@ -23,11 +23,11 @@ class ModerationApi :feedback, :queue, :actions, + :content, :webhooks, :webhook_secret, :account, :wordlist, - :content, :projects, :channels ) @@ -107,11 +107,11 @@ def init_sdks @feedback = Feedback.new(@sdk_configuration) @queue = Queue.new(@sdk_configuration) @actions = Actions.new(@sdk_configuration) + @content = Content.new(@sdk_configuration) @webhooks = Webhooks.new(@sdk_configuration) @webhook_secret = WebhookSecret.new(@sdk_configuration) @account = Account.new(@sdk_configuration) @wordlist = Wordlist.new(@sdk_configuration) - @content = Content.new(@sdk_configuration) @projects = Projects.new(@sdk_configuration) @channels = Channels.new(@sdk_configuration) end diff --git a/lib/moderation_api/sdkconfiguration.rb b/lib/moderation_api/sdkconfiguration.rb index ae85557b..7189c117 100644 --- a/lib/moderation_api/sdkconfiguration.rb +++ b/lib/moderation_api/sdkconfiguration.rb @@ -93,9 +93,9 @@ def initialize(client, hooks, retry_config, timeout_ms, secret_key, security_sou @language = "ruby" @openapi_doc_version = "1.1.0" - @sdk_version = "3.2.0" + @sdk_version = "3.3.0" @gen_version = "internal" - @user_agent = "speakeasy-sdk/ruby 3.2.0 internal 1.1.0 moderation_api" + @user_agent = "speakeasy-sdk/ruby 3.3.0 internal 1.1.0 moderation_api" end sig { returns([String, T::Hash[Symbol, String]]) } diff --git a/moderation_api.gemspec b/moderation_api.gemspec index 78dd8cd7..f7d13010 100644 --- a/moderation_api.gemspec +++ b/moderation_api.gemspec @@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__) Gem::Specification.new do |s| s.name = 'moderation_api' - s.version = '3.2.0' + s.version = '3.3.0' s.platform = Gem::Platform::RUBY s.licenses = ['Apache-2.0'] s.summary = ''