diff --git a/.github/release-notes/v3.0.0.md b/.github/release-notes/v3.0.0.md index ff7a5fd1..02ebae6b 100644 --- a/.github/release-notes/v3.0.0.md +++ b/.github/release-notes/v3.0.0.md @@ -9,7 +9,7 @@ gem install moderation_api -v "~> 3.0" ### Ruby-specific changes - The module is `ModerationApi` (was `ModerationAPI`). Create the client with `ModerationApi::ModerationApi.new(secret_key: ENV.fetch("MODAPI_SECRET_KEY"))`. -- Requests are typed objects, for example `Operations::SubmitContentRequest.new(content: Operations::TextRequest.new(text: "..."))`, and responses carry the result in `.object`. Sorbet type signatures are included. +- Requests are typed objects, for example `Operations::SubmitContentRequestBody.new(content: Operations::TextRequest.new(text: "..."))`, and responses carry the result in `.object`. Sorbet type signatures are included. - Verify webhooks with `require "moderation_api/webhook_signature"` and `ModerationApi::WebhookSignature.construct_event(payload, signature)`. ### What's new diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 7d092e52..d4f872ac 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: c27787b45fc5b72aafff31ba945a9e61 + docChecksum: 38730339aa1da77855e86c169896f12f docVersion: 1.1.0 speakeasyVersion: internal generationVersion: internal - releaseVersion: 3.1.0 - configChecksum: d394a681c78d7e75a42f9911e6bba463 + releaseVersion: 3.1.1 + configChecksum: 6d84855e7fac71cdbcc700bbc8102e87 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:845cf20712b81ec8ccacfdb698fa691e7f776ff5 + last_write_checksum: sha1:f506e56bb9f5f60261e76361a78ccd3239079288 Rakefile: last_write_checksum: sha1:c572639efdae8c7b24141ee5c02d8f009e101ed8 USAGE.md: @@ -2144,7 +2144,7 @@ trackedFiles: lib/moderation_api/sdk_hooks/types.rb: last_write_checksum: sha1:4c965332c50ba795946cf8df50a6202e89db0a45 lib/moderation_api/sdkconfiguration.rb: - last_write_checksum: sha1:6903a5aaac8e69fc9c4980b3c4d058956e905469 + last_write_checksum: sha1:f7dfc163b0483e449e76faa2d9c7d2e54322137e lib/moderation_api/sdkconfiguration.rbi: last_write_checksum: sha1:0ff7c53716ae2b6668c84ad4f83b9a8697482c33 lib/moderation_api/utils/forms.rb: @@ -2172,7 +2172,7 @@ trackedFiles: lib/moderation_api/words.rb: last_write_checksum: sha1:1caff3b1db9983d6cd6d76e0f90d47a39e376842 moderation_api.gemspec: - last_write_checksum: sha1:9cd7f7552878319cf4c9ce64e4fe6fadb40050f9 + last_write_checksum: sha1:071948ee566406c7314b8ff48f67d64576c4069c sorbet/config: last_write_checksum: sha1:d02b32628dad70edc5929a9b9801d5e2dca15d40 sorbet/rbi/annotations/.gitattributes: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 7bd157a2..a6580bd9 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false ruby: - version: 3.1.0 + version: 3.1.1 additionalDependencies: development: {} runtime: {} diff --git a/.speakeasy/openapi.json b/.speakeasy/openapi.json index 88ae723f..31ff464a 100644 --- a/.speakeasy/openapi.json +++ b/.speakeasy/openapi.json @@ -7,7 +7,7 @@ }, "servers": [ { - "url": "https://moderationapi.com/api/v1" + "url": "https://api.moderationapi.com/v1" } ], "tags": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index b7867dfe..58f34b60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.1.1 (2026-10-22) + +Full Changelog: [v3.1.0...v3.1.1](https://github.com/moderation-api/sdk-ruby/compare/v3.1.0...v3.1.1) + +### Chores + +- Update the generated code. + ## 3.1.0 (2026-10-22) Full Changelog: [v3.0.0...v3.1.0](https://github.com/moderation-api/sdk-ruby/compare/v3.0.0...v3.1.0) diff --git a/Gemfile.lock b/Gemfile.lock index 47d2fb34..8cfbc005 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - moderation_api (3.1.0) + moderation_api (3.1.1) faraday faraday-multipart faraday-retry diff --git a/README.md b/README.md index 02cd5e10..4fca33ee 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Operations = ModerationApi::Models::Operations client = ModerationApi::ModerationApi.new(secret_key: ENV.fetch("MODAPI_SECRET_KEY")) # Text -client.content.submit(request: Operations::SubmitContentRequest.new( +client.content.submit(body: Operations::SubmitContentRequestBody.new( content: Operations::TextRequest.new(text: "Your text here"), content_id: "message-123", # your ID for the content author_id: "user-123", # your ID for the user who wrote it @@ -104,18 +104,18 @@ client.content.submit(request: Operations::SubmitContentRequest.new( )) # Image, video and audio: send a URL -client.content.submit(request: Operations::SubmitContentRequest.new( +client.content.submit(body: Operations::SubmitContentRequestBody.new( content: Operations::ImageRequest.new(url: "https://example.com/image.jpg") )) -client.content.submit(request: Operations::SubmitContentRequest.new( +client.content.submit(body: Operations::SubmitContentRequestBody.new( content: Operations::VideoRequest.new(url: "https://example.com/video.mp4") )) -client.content.submit(request: Operations::SubmitContentRequest.new( +client.content.submit(body: Operations::SubmitContentRequestBody.new( content: Operations::AudioRequest.new(url: "https://example.com/audio.mp3") )) # An object with several fields, moderated together -client.content.submit(request: Operations::SubmitContentRequest.new( +client.content.submit(body: Operations::SubmitContentRequestBody.new( content: Operations::Object.new(data: { title: Operations::DataText.new(text: "Post title"), body: Operations::DataText.new(text: "Post content"), @@ -129,7 +129,7 @@ client.content.submit(request: Operations::SubmitContentRequest.new( `evaluation.flagged` tells you if any policy flagged the content. `recommendation.action` is the action the API recommends after it applies your thresholds and rules: `allow`, `review` or `reject`. ```ruby -response = client.content.submit(request: Operations::SubmitContentRequest.new( +response = client.content.submit(body: Operations::SubmitContentRequestBody.new( content: Operations::TextRequest.new(text: "Some content") )) result = response.object @@ -405,7 +405,7 @@ require "moderation_api" Models = ::ModerationApi::Models s = ::ModerationApi::ModerationApi.new( - server_url: "https://moderationapi.com/api/v1", + server_url: "https://api.moderationapi.com/v1", secret_key: "" ) @@ -433,7 +433,7 @@ client = ModerationApi::ModerationApi.new( ) client.content.submit( - request: Operations::SubmitContentRequest.new(content: Operations::TextRequest.new(text: "Hello")), + body: Operations::SubmitContentRequestBody.new(content: Operations::TextRequest.new(text: "Hello")), timeout_ms: 5_000 ) ``` diff --git a/lib/moderation_api/sdkconfiguration.rb b/lib/moderation_api/sdkconfiguration.rb index 566287c1..87024b23 100644 --- a/lib/moderation_api/sdkconfiguration.rb +++ b/lib/moderation_api/sdkconfiguration.rb @@ -16,7 +16,7 @@ module ModerationApi SERVERS = T.let( [ - "https://moderationapi.com/api/v1" + "https://api.moderationapi.com/v1" ].freeze, T::Array[String] ) @@ -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.1.0" + @sdk_version = "3.1.1" @gen_version = "internal" - @user_agent = "speakeasy-sdk/ruby 3.1.0 internal 1.1.0 moderation_api" + @user_agent = "speakeasy-sdk/ruby 3.1.1 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 964b27d3..e101cea3 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.1.0' + s.version = '3.1.1' s.platform = Gem::Platform::RUBY s.licenses = ['Apache-2.0'] s.summary = ''