Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/release-notes/v3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ generation:
generateNewTests: true
skipResponseBodyAssertions: false
ruby:
version: 3.1.0
version: 3.1.1
additionalDependencies:
development: {}
runtime: {}
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"servers": [
{
"url": "https://moderationapi.com/api/v1"
"url": "https://api.moderationapi.com/v1"
}
],
"tags": [
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
moderation_api (3.1.0)
moderation_api (3.1.1)
faraday
faraday-multipart
faraday-retry
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"),
Expand All @@ -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
Expand Down Expand Up @@ -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: "<YOUR_BEARER_TOKEN_HERE>"
)

Expand Down Expand Up @@ -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
)
```
Expand Down
6 changes: 3 additions & 3 deletions lib/moderation_api/sdkconfiguration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module ModerationApi

SERVERS = T.let(
[
"https://moderationapi.com/api/v1"
"https://api.moderationapi.com/v1"
].freeze,
T::Array[String]
)
Expand Down Expand Up @@ -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]]) }
Expand Down
2 changes: 1 addition & 1 deletion moderation_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
Loading