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.15.0"
".": "2.16.0"
}
6 changes: 3 additions & 3 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-6fe842e0549fd5b4fdb1cca0bf44fa9f71a107ca98eb30a9bb3e4d3c2adeaca9.yml
openapi_spec_hash: ee56658b235950cbf3808b56ddde4919
config_hash: 13d10207114afb65f7ac4e21f4c0e358
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-5d59d9b7fffd1ac6f329a62fdc42c97bfa7821168eeea0d686a2d48d90963c34.yml
openapi_spec_hash: 61cd471624938b233f02dc17416946f2
config_hash: 9d144cc6c49d3fd53e5b4472c1e22165
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.16.0 (2026-05-08)

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

### Features

* **api:** api update ([b84cbe4](https://github.com/moderation-api/sdk-ruby/commit/b84cbe4d456abf5ede25c5754295f498daa8b3ac))
* **api:** manual updates ([0293cc9](https://github.com/moderation-api/sdk-ruby/commit/0293cc979a8cae07a2b6a8fc12c34d882ce0337a))

## 2.15.0 (2026-05-06)

Full Changelog: [v2.14.0...v2.15.0](https://github.com/moderation-api/sdk-ruby/compare/v2.14.0...v2.15.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.15.0)
moderation_api (2.16.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.15.0"
gem "moderation_api", "~> 2.16.0"
```

<!-- x-release-please-end -->
Expand Down
1 change: 1 addition & 0 deletions lib/moderation_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
require_relative "moderation_api/models/queue_get_stats_response"
require_relative "moderation_api/models/queue_retrieve_params"
require_relative "moderation_api/models/queue_retrieve_response"
require_relative "moderation_api/models/webhook_event"
require_relative "moderation_api/models/wordlist/word_add_params"
require_relative "moderation_api/models/wordlist/word_add_response"
require_relative "moderation_api/models/wordlist/word_remove_params"
Expand Down
25 changes: 25 additions & 0 deletions lib/moderation_api/internal/type/union.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ module ModerationAPI
module Internal
module Type
# @api private
#
# @example
# # `webhook_event` is a `ModerationAPI::WebhookEvent`
# case webhook_event
# when ModerationAPI::WebhookEvent::AuthorBlocked
# puts(webhook_event.id)
# when ModerationAPI::WebhookEvent::AuthorUnblocked
# puts(webhook_event.api_version)
# when ModerationAPI::WebhookEvent::AuthorSuspended
# puts(webhook_event.created)
# else
# puts(webhook_event)
# end
#
# @example
# case webhook_event
# in {type: :"author.blocked", id: id, api_version: api_version, created: created}
# puts(id)
# in {type: :"author.unblocked", id: id, api_version: api_version, created: created}
# puts(api_version)
# in {type: :"author.suspended", id: id, api_version: api_version, created: created}
# puts(created)
# else
# puts(webhook_event)
# end
module Union
include ModerationAPI::Internal::Type::Converter
include ModerationAPI::Internal::Util::SorbetRuntimeSupport
Expand Down
2 changes: 2 additions & 0 deletions lib/moderation_api/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ module ModerationAPI

QueueRetrieveParams = ModerationAPI::Models::QueueRetrieveParams

WebhookEvent = ModerationAPI::Models::WebhookEvent

Wordlist = ModerationAPI::Models::Wordlist

WordlistGetEmbeddingStatusParams = ModerationAPI::Models::WordlistGetEmbeddingStatusParams
Expand Down
46 changes: 1 addition & 45 deletions lib/moderation_api/models/action_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,7 @@ class ActionCreateParams < ModerationAPI::Internal::Type::BaseModel
# @return [Boolean, nil]
optional :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired

# @!attribute webhooks
# The action's webhooks.
#
# @return [Array<ModerationAPI::Models::ActionCreateParams::Webhook>, nil]
optional :webhooks,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::ActionCreateParams::Webhook] }

# @!method initialize(name:, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil, webhooks: nil, request_options: {})
# @!method initialize(name:, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::ActionCreateParams} for more details.
#
Expand All @@ -118,8 +111,6 @@ class ActionCreateParams < ModerationAPI::Internal::Type::BaseModel
#
# @param value_required [Boolean] Whether the action requires a value to be executed.
#
# @param webhooks [Array<ModerationAPI::Models::ActionCreateParams::Webhook>] The action's webhooks.
#
# @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}]

# Show the action in all queues, selected queues or no queues (to use via API
Expand Down Expand Up @@ -177,41 +168,6 @@ module Type
# @!method self.values
# @return [Array<Symbol>]
end

class Webhook < ModerationAPI::Internal::Type::BaseModel
# @!attribute name
# The webhook's name, used to identify it in the dashboard
#
# @return [String]
required :name, String

# @!attribute url
# The webhook's URL. We'll call this URL when the event occurs.
#
# @return [String]
required :url, String

# @!attribute id
# ID of an existing webhook or undefined if this is a new webhook.
#
# @return [String, nil]
optional :id, String

# @!attribute description
# The webhook's description
#
# @return [String, nil]
optional :description, String, nil?: true

# @!method initialize(name:, url:, id: nil, description: nil)
# @param name [String] The webhook's name, used to identify it in the dashboard
#
# @param url [String] The webhook's URL. We'll call this URL when the event occurs.
#
# @param id [String] ID of an existing webhook or undefined if this is a new webhook.
#
# @param description [String, nil] The webhook's description
end
end
end
end
58 changes: 1 addition & 57 deletions lib/moderation_api/models/action_list_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ class ActionListResponseItem < ModerationAPI::Internal::Type::BaseModel
# @return [Boolean]
required :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired

# @!attribute webhooks
# The action's webhooks.
#
# @return [Array<ModerationAPI::Models::ActionListResponseItem::Webhook>]
required :webhooks,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionListResponseItem::Webhook] }

# @!attribute description
# The description of the action.
#
Expand All @@ -98,7 +91,7 @@ class ActionListResponseItem < ModerationAPI::Internal::Type::BaseModel
# @return [Symbol, ModerationAPI::Models::ActionListResponseItem::Type, nil]
optional :type, enum: -> { ModerationAPI::Models::ActionListResponseItem::Type }, nil?: true

# @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, webhooks:, description: nil, key: nil, type: nil)
# @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, description: nil, key: nil, type: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::ActionListResponseItem} for more details.
#
Expand All @@ -122,8 +115,6 @@ class ActionListResponseItem < ModerationAPI::Internal::Type::BaseModel
#
# @param value_required [Boolean] Whether the action requires a value to be executed.
#
# @param webhooks [Array<ModerationAPI::Models::ActionListResponseItem::Webhook>] The action's webhooks.
#
# @param description [String, nil] The description of the action.
#
# @param key [String, nil] User defined key of the action.
Expand Down Expand Up @@ -171,53 +162,6 @@ module QueueBehaviour
# @return [Array<Symbol>]
end

class Webhook < ModerationAPI::Internal::Type::BaseModel
# @!attribute id
# The ID of the webhook.
#
# @return [String]
required :id, String

# @!attribute name
# The webhook's name, used to identify it in the dashboard
#
# @return [String]
required :name, String

# @!attribute url
# The webhook's URL. We'll call this URL when the event occurs.
#
# @return [String]
required :url, String

# @!attribute description
# The webhook's description
#
# @return [String, nil]
optional :description, String, nil?: true

# @!attribute moderation_action_id
# The ID of the moderation action to trigger the webhook on. Only used for
# moderation action webhooks.
#
# @return [String, nil]
optional :moderation_action_id, String, api_name: :moderationActionId, nil?: true

# @!method initialize(id:, name:, url:, description: nil, moderation_action_id: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::ActionListResponseItem::Webhook} for more details.
#
# @param id [String] The ID of the webhook.
#
# @param name [String] The webhook's name, used to identify it in the dashboard
#
# @param url [String] The webhook's URL. We'll call this URL when the event occurs.
#
# @param description [String, nil] The webhook's description
#
# @param moderation_action_id [String, nil] The ID of the moderation action to trigger the webhook on. Only used for moderat
end

# The type of the action.
#
# @see ModerationAPI::Models::ActionListResponseItem#type
Expand Down
58 changes: 1 addition & 57 deletions lib/moderation_api/models/action_retrieve_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ class ActionRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
# @return [Boolean]
required :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired

# @!attribute webhooks
# The action's webhooks.
#
# @return [Array<ModerationAPI::Models::ActionRetrieveResponse::Webhook>]
required :webhooks,
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionRetrieveResponse::Webhook] }

# @!attribute description
# The description of the action.
#
Expand All @@ -99,7 +92,7 @@ class ActionRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
# @return [Symbol, ModerationAPI::Models::ActionRetrieveResponse::Type, nil]
optional :type, enum: -> { ModerationAPI::Models::ActionRetrieveResponse::Type }, nil?: true

# @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, webhooks:, description: nil, key: nil, type: nil)
# @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, description: nil, key: nil, type: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::ActionRetrieveResponse} for more details.
#
Expand All @@ -123,8 +116,6 @@ class ActionRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
#
# @param value_required [Boolean] Whether the action requires a value to be executed.
#
# @param webhooks [Array<ModerationAPI::Models::ActionRetrieveResponse::Webhook>] The action's webhooks.
#
# @param description [String, nil] The description of the action.
#
# @param key [String, nil] User defined key of the action.
Expand Down Expand Up @@ -172,53 +163,6 @@ module QueueBehaviour
# @return [Array<Symbol>]
end

class Webhook < ModerationAPI::Internal::Type::BaseModel
# @!attribute id
# The ID of the webhook.
#
# @return [String]
required :id, String

# @!attribute name
# The webhook's name, used to identify it in the dashboard
#
# @return [String]
required :name, String

# @!attribute url
# The webhook's URL. We'll call this URL when the event occurs.
#
# @return [String]
required :url, String

# @!attribute description
# The webhook's description
#
# @return [String, nil]
optional :description, String, nil?: true

# @!attribute moderation_action_id
# The ID of the moderation action to trigger the webhook on. Only used for
# moderation action webhooks.
#
# @return [String, nil]
optional :moderation_action_id, String, api_name: :moderationActionId, nil?: true

# @!method initialize(id:, name:, url:, description: nil, moderation_action_id: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::ActionRetrieveResponse::Webhook} for more details.
#
# @param id [String] The ID of the webhook.
#
# @param name [String] The webhook's name, used to identify it in the dashboard
#
# @param url [String] The webhook's URL. We'll call this URL when the event occurs.
#
# @param description [String, nil] The webhook's description
#
# @param moderation_action_id [String, nil] The ID of the moderation action to trigger the webhook on. Only used for moderat
end

# The type of the action.
#
# @see ModerationAPI::Models::ActionRetrieveResponse#type
Expand Down
Loading