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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.27.0"
".": "2.28.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 27
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-4f75d58eb24cf0975c540c0317b7e163a4b25fc41fe5da1751977ca703b812bf.yml
openapi_spec_hash: 87ae9898b5ba445f9785c1a10790cf7b
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-317272429c96ee7d56a914736b87148fa21d8633cc852697ae293c50fde29531.yml
openapi_spec_hash: fb74bd59fcba6e28af9fe34844bb965f
config_hash: 9d144cc6c49d3fd53e5b4472c1e22165
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.28.0 (2026-07-23)

Full Changelog: [v2.27.0...v2.28.0](https://github.com/moderation-api/sdk-ruby/compare/v2.27.0...v2.28.0)

### Features

* **api:** api update ([5db8ada](https://github.com/moderation-api/sdk-ruby/commit/5db8adafdfa072702d7e67b29c7a0f02598703d0))

## 2.27.0 (2026-07-20)

Full Changelog: [v2.26.0...v2.27.0](https://github.com/moderation-api/sdk-ruby/compare/v2.26.0...v2.27.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
moderation_api (2.27.0)
moderation_api (2.28.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "moderation_api", "~> 2.27.0"
gem "moderation_api", "~> 2.28.0"
```

<!-- x-release-please-end -->
Expand Down
8 changes: 7 additions & 1 deletion lib/moderation_api/models/content_submit_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,16 @@ class Label < ModerationAPI::Internal::Type::BaseModel
# @return [Float]
required :probability, Float

# @!method initialize(id:, flagged:, probability:)
# @!attribute shadow_flagged
#
# @return [Boolean, nil]
optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean, api_name: :shadowFlagged

# @!method initialize(id:, flagged:, probability:, shadow_flagged: nil)
# @param id [String]
# @param flagged [Boolean]
# @param probability [Float]
# @param shadow_flagged [Boolean]
end
end

Expand Down
60 changes: 56 additions & 4 deletions lib/moderation_api/models/webhook_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2900,7 +2900,18 @@ class Label < ModerationAPI::Internal::Type::BaseModel
optional :matches,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match] }

# @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil)
# @!attribute shadow_flagged
# Whether this label crossed its threshold under a shadowed policy — reported for
# visibility, never counted toward a flagging decision
#
# @return [Boolean, nil]
optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean

# @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil, shadow_flagged: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label}
# for more details.
#
# @param label [String] The label name
#
# @param score [Float] Confidence score between 0 and 1
Expand All @@ -2910,6 +2921,8 @@ class Label < ModerationAPI::Internal::Type::BaseModel
# @param manual [Boolean] True if the label was applied manually by a moderator
#
# @param matches [Array<ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match>]
#
# @param shadow_flagged [Boolean] Whether this label crossed its threshold under a shadowed policy — reported for

class Match < ModerationAPI::Internal::Type::BaseModel
# @!attribute match
Expand Down Expand Up @@ -4258,7 +4271,18 @@ class Label < ModerationAPI::Internal::Type::BaseModel
optional :matches,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match] }

# @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil)
# @!attribute shadow_flagged
# Whether this label crossed its threshold under a shadowed policy — reported for
# visibility, never counted toward a flagging decision
#
# @return [Boolean, nil]
optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean

# @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil, shadow_flagged: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label}
# for more details.
#
# @param label [String] The label name
#
# @param score [Float] Confidence score between 0 and 1
Expand All @@ -4268,6 +4292,8 @@ class Label < ModerationAPI::Internal::Type::BaseModel
# @param manual [Boolean] True if the label was applied manually by a moderator
#
# @param matches [Array<ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match>]
#
# @param shadow_flagged [Boolean] Whether this label crossed its threshold under a shadowed policy — reported for

class Match < ModerationAPI::Internal::Type::BaseModel
# @!attribute match
Expand Down Expand Up @@ -5337,7 +5363,18 @@ class Label < ModerationAPI::Internal::Type::BaseModel
optional :matches,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match] }

# @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil)
# @!attribute shadow_flagged
# Whether this label crossed its threshold under a shadowed policy — reported for
# visibility, never counted toward a flagging decision
#
# @return [Boolean, nil]
optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean

# @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil, shadow_flagged: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label}
# for more details.
#
# @param label [String] The label name
#
# @param score [Float] Confidence score between 0 and 1
Expand All @@ -5347,6 +5384,8 @@ class Label < ModerationAPI::Internal::Type::BaseModel
# @param manual [Boolean] True if the label was applied manually by a moderator
#
# @param matches [Array<ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match>]
#
# @param shadow_flagged [Boolean] Whether this label crossed its threshold under a shadowed policy — reported for

class Match < ModerationAPI::Internal::Type::BaseModel
# @!attribute match
Expand Down Expand Up @@ -6413,7 +6452,18 @@ class Label < ModerationAPI::Internal::Type::BaseModel
optional :matches,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match] }

# @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil)
# @!attribute shadow_flagged
# Whether this label crossed its threshold under a shadowed policy — reported for
# visibility, never counted toward a flagging decision
#
# @return [Boolean, nil]
optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean

# @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil, shadow_flagged: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label}
# for more details.
#
# @param label [String] The label name
#
# @param score [Float] Confidence score between 0 and 1
Expand All @@ -6423,6 +6473,8 @@ class Label < ModerationAPI::Internal::Type::BaseModel
# @param manual [Boolean] True if the label was applied manually by a moderator
#
# @param matches [Array<ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match>]
#
# @param shadow_flagged [Boolean] Whether this label crossed its threshold under a shadowed policy — reported for

class Match < ModerationAPI::Internal::Type::BaseModel
# @!attribute match
Expand Down
2 changes: 1 addition & 1 deletion lib/moderation_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ModerationAPI
VERSION = "2.27.0"
VERSION = "2.28.0"
end
18 changes: 15 additions & 3 deletions rbi/moderation_api/models/content_submit_response.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -1208,19 +1208,31 @@ module ModerationAPI
sig { returns(Float) }
attr_accessor :probability

sig { returns(T.nilable(T::Boolean)) }
attr_reader :shadow_flagged

sig { params(shadow_flagged: T::Boolean).void }
attr_writer :shadow_flagged

sig do
params(
id: String,
flagged: T::Boolean,
probability: Float
probability: Float,
shadow_flagged: T::Boolean
).returns(T.attached_class)
end
def self.new(id:, flagged:, probability:)
def self.new(id:, flagged:, probability:, shadow_flagged: nil)
end

sig do
override.returns(
{ id: String, flagged: T::Boolean, probability: Float }
{
id: String,
flagged: T::Boolean,
probability: Float,
shadow_flagged: T::Boolean
}
)
end
def to_hash
Expand Down
Loading