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.14.0"
".": "2.15.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%2Fmoderation-api-5cee858ce17e48e25e7503767dd979c6570a485511274e48129a1922eae67098.yml
openapi_spec_hash: 54c716ac4e888bfddc2c6402192bb33a
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-6fe842e0549fd5b4fdb1cca0bf44fa9f71a107ca98eb30a9bb3e4d3c2adeaca9.yml
openapi_spec_hash: ee56658b235950cbf3808b56ddde4919
config_hash: 13d10207114afb65f7ac4e21f4c0e358
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 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)

### Features

* **api:** api update ([db53bf6](https://github.com/moderation-api/sdk-ruby/commit/db53bf6ff1ba85a2a7fab66b097317133a377e5f))

## 2.14.0 (2026-04-29)

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

<!-- x-release-please-end -->
Expand Down
10 changes: 9 additions & 1 deletion lib/moderation_api/models/author_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class AuthorCreateParams < ModerationAPI::Internal::Type::BaseModel
# @return [String]
required :external_id, String

# @!attribute company
# The author's company or organization
#
# @return [String, nil]
optional :company, String, nil?: true

# @!attribute email
# Author email address
#
Expand Down Expand Up @@ -61,12 +67,14 @@ class AuthorCreateParams < ModerationAPI::Internal::Type::BaseModel
# @return [String, nil]
optional :profile_picture, String, nil?: true

# @!method initialize(external_id:, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {})
# @!method initialize(external_id:, company: nil, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::AuthorCreateParams} for more details.
#
# @param external_id [String] External ID of the user, typically the ID of the author in your database.
#
# @param company [String, nil] The author's company or organization
#
# @param email [String, nil] Author email address
#
# @param external_link [String, nil] URL of the author's external profile
Expand Down
10 changes: 9 additions & 1 deletion lib/moderation_api/models/author_create_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ class AuthorCreateResponse < ModerationAPI::Internal::Type::BaseModel
# @return [ModerationAPI::Models::AuthorCreateResponse::TrustLevel]
required :trust_level, -> { ModerationAPI::Models::AuthorCreateResponse::TrustLevel }

# @!attribute company
# The author's company or organization
#
# @return [String, nil]
optional :company, String, nil?: true

# @!attribute email
# Author email address
#
Expand Down Expand Up @@ -93,7 +99,7 @@ class AuthorCreateResponse < ModerationAPI::Internal::Type::BaseModel
# @return [String, nil]
optional :profile_picture, String, nil?: true

# @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
# @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::AuthorCreateResponse} for more details.
#
Expand All @@ -115,6 +121,8 @@ class AuthorCreateResponse < ModerationAPI::Internal::Type::BaseModel
#
# @param trust_level [ModerationAPI::Models::AuthorCreateResponse::TrustLevel]
#
# @param company [String, nil] The author's company or organization
#
# @param email [String, nil] Author email address
#
# @param external_id [String, nil] The author's ID from your system
Expand Down
10 changes: 9 additions & 1 deletion lib/moderation_api/models/author_list_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class Author < ModerationAPI::Internal::Type::BaseModel
# @return [ModerationAPI::Models::AuthorListResponse::Author::TrustLevel]
required :trust_level, -> { ModerationAPI::Models::AuthorListResponse::Author::TrustLevel }

# @!attribute company
# The author's company or organization
#
# @return [String, nil]
optional :company, String, nil?: true

# @!attribute email
# Author email address
#
Expand Down Expand Up @@ -111,7 +117,7 @@ class Author < ModerationAPI::Internal::Type::BaseModel
# @return [String, nil]
optional :profile_picture, String, nil?: true

# @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
# @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::AuthorListResponse::Author} for more details.
#
Expand All @@ -133,6 +139,8 @@ class Author < ModerationAPI::Internal::Type::BaseModel
#
# @param trust_level [ModerationAPI::Models::AuthorListResponse::Author::TrustLevel]
#
# @param company [String, nil] The author's company or organization
#
# @param email [String, nil] Author email address
#
# @param external_id [String, nil] The author's ID from your system
Expand Down
10 changes: 9 additions & 1 deletion lib/moderation_api/models/author_retrieve_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class AuthorRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
# @return [ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel]
required :trust_level, -> { ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel }

# @!attribute company
# The author's company or organization
#
# @return [String, nil]
optional :company, String, nil?: true

# @!attribute email
# Author email address
#
Expand Down Expand Up @@ -95,7 +101,7 @@ class AuthorRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
# @return [String, nil]
optional :profile_picture, String, nil?: true

# @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
# @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::AuthorRetrieveResponse} for more details.
#
Expand All @@ -117,6 +123,8 @@ class AuthorRetrieveResponse < ModerationAPI::Internal::Type::BaseModel
#
# @param trust_level [ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel]
#
# @param company [String, nil] The author's company or organization
#
# @param email [String, nil] Author email address
#
# @param external_id [String, nil] The author's ID from your system
Expand Down
10 changes: 9 additions & 1 deletion lib/moderation_api/models/author_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class AuthorUpdateParams < ModerationAPI::Internal::Type::BaseModel
# @return [String]
required :id, String

# @!attribute company
# The author's company or organization
#
# @return [String, nil]
optional :company, String, nil?: true

# @!attribute email
# Author email address
#
Expand Down Expand Up @@ -61,12 +67,14 @@ class AuthorUpdateParams < ModerationAPI::Internal::Type::BaseModel
# @return [String, nil]
optional :profile_picture, String, nil?: true

# @!method initialize(id:, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {})
# @!method initialize(id:, company: nil, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::AuthorUpdateParams} for more details.
#
# @param id [String] Either external ID or the ID assigned by moderation API.
#
# @param company [String, nil] The author's company or organization
#
# @param email [String, nil] Author email address
#
# @param external_link [String, nil] URL of the author's external profile
Expand Down
10 changes: 9 additions & 1 deletion lib/moderation_api/models/author_update_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ class AuthorUpdateResponse < ModerationAPI::Internal::Type::BaseModel
# @return [ModerationAPI::Models::AuthorUpdateResponse::TrustLevel]
required :trust_level, -> { ModerationAPI::Models::AuthorUpdateResponse::TrustLevel }

# @!attribute company
# The author's company or organization
#
# @return [String, nil]
optional :company, String, nil?: true

# @!attribute email
# Author email address
#
Expand Down Expand Up @@ -93,7 +99,7 @@ class AuthorUpdateResponse < ModerationAPI::Internal::Type::BaseModel
# @return [String, nil]
optional :profile_picture, String, nil?: true

# @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
# @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::AuthorUpdateResponse} for more details.
#
Expand All @@ -115,6 +121,8 @@ class AuthorUpdateResponse < ModerationAPI::Internal::Type::BaseModel
#
# @param trust_level [ModerationAPI::Models::AuthorUpdateResponse::TrustLevel]
#
# @param company [String, nil] The author's company or organization
#
# @param email [String, nil] Author email address
#
# @param external_id [String, nil] The author's ID from your system
Expand Down
13 changes: 12 additions & 1 deletion lib/moderation_api/models/content_submit_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1045,12 +1045,21 @@ class URLRisk < ModerationAPI::Internal::Type::BaseModel
ModerationAPI::Internal::Type::ArrayOf[String],
api_name: :blocklistWordlistIds

# @!attribute flag_link_shorteners
# When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl,
# etc.) is always flagged regardless of risk score. Allowlist matches still win.
#
# @return [Boolean, nil]
optional :flag_link_shorteners,
ModerationAPI::Internal::Type::Boolean,
api_name: :flagLinkShorteners

# @!attribute threshold
#
# @return [Float, nil]
optional :threshold, Float

# @!method initialize(flag:, allowlist_wordlist_ids: nil, blocklist_wordlist_ids: nil, threshold: nil, id: :url_risk)
# @!method initialize(flag:, allowlist_wordlist_ids: nil, blocklist_wordlist_ids: nil, flag_link_shorteners: nil, threshold: nil, id: :url_risk)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk} for more details.
#
Expand All @@ -1060,6 +1069,8 @@ class URLRisk < ModerationAPI::Internal::Type::BaseModel
#
# @param blocklist_wordlist_ids [Array<String>] IDs of wordlists whose entries are treated as blocked URL domains. Matches short
#
# @param flag_link_shorteners [Boolean] When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl, etc
#
# @param threshold [Float]
#
# @param id [Symbol, :url_risk]
Expand Down
8 changes: 6 additions & 2 deletions lib/moderation_api/resources/authors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ class Authors
# Create a new author. Typically not needed as authors are created automatically
# when content is moderated.
#
# @overload create(external_id:, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {})
# @overload create(external_id:, company: nil, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {})
#
# @param external_id [String] External ID of the user, typically the ID of the author in your database.
#
# @param company [String, nil] The author's company or organization
#
# @param email [String, nil] Author email address
#
# @param external_link [String, nil] URL of the author's external profile
Expand Down Expand Up @@ -71,10 +73,12 @@ def retrieve(id, params = {})
#
# Update the details of a specific author
#
# @overload update(id, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {})
# @overload update(id, company: nil, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {})
#
# @param id [String] Either external ID or the ID assigned by moderation API.
#
# @param company [String, nil] The author's company or organization
#
# @param email [String, nil] Author email address
#
# @param external_link [String, nil] URL of the author's external profile
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.14.0"
VERSION = "2.15.0"
end
8 changes: 8 additions & 0 deletions rbi/moderation_api/models/author_create_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ module ModerationAPI
sig { returns(String) }
attr_accessor :external_id

# The author's company or organization
sig { returns(T.nilable(String)) }
attr_accessor :company

# Author email address
sig { returns(T.nilable(String)) }
attr_accessor :email
Expand Down Expand Up @@ -66,6 +70,7 @@ module ModerationAPI
sig do
params(
external_id: String,
company: T.nilable(String),
email: T.nilable(String),
external_link: T.nilable(String),
first_seen: Float,
Expand All @@ -80,6 +85,8 @@ module ModerationAPI
def self.new(
# External ID of the user, typically the ID of the author in your database.
external_id:,
# The author's company or organization
company: nil,
# Author email address
email: nil,
# URL of the author's external profile
Expand All @@ -104,6 +111,7 @@ module ModerationAPI
override.returns(
{
external_id: String,
company: T.nilable(String),
email: T.nilable(String),
external_link: T.nilable(String),
first_seen: Float,
Expand Down
8 changes: 8 additions & 0 deletions rbi/moderation_api/models/author_create_response.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ module ModerationAPI
end
attr_writer :trust_level

# The author's company or organization
sig { returns(T.nilable(String)) }
attr_accessor :company

# Author email address
sig { returns(T.nilable(String)) }
attr_accessor :email
Expand Down Expand Up @@ -142,6 +146,7 @@ module ModerationAPI
status: ModerationAPI::Models::AuthorCreateResponse::Status::OrSymbol,
trust_level:
ModerationAPI::Models::AuthorCreateResponse::TrustLevel::OrHash,
company: T.nilable(String),
email: T.nilable(String),
external_id: T.nilable(String),
external_link: T.nilable(String),
Expand All @@ -168,6 +173,8 @@ module ModerationAPI
# Current author status
status:,
trust_level:,
# The author's company or organization
company: nil,
# Author email address
email: nil,
# The author's ID from your system
Expand Down Expand Up @@ -201,6 +208,7 @@ module ModerationAPI
ModerationAPI::Models::AuthorCreateResponse::Status::TaggedSymbol,
trust_level:
ModerationAPI::Models::AuthorCreateResponse::TrustLevel,
company: T.nilable(String),
email: T.nilable(String),
external_id: T.nilable(String),
external_link: T.nilable(String),
Expand Down
Loading