From b7e4375b627d949a7e9ac5794703793c9da54415 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 2 Jan 2026 15:32:10 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- LICENSE | 2 +- .../models/content_submit_params.rb | 92 ++------ .../models/content_submit_params.rbi | 218 +++--------------- .../models/content_submit_params.rbs | 122 +++------- 5 files changed, 93 insertions(+), 345 deletions(-) diff --git a/.stats.yml b/.stats.yml index 65327ac..bc3bcfa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-00324cd69f885e08708180c380317fd48101cb81c36f0bfaf7f8248d951d92f7.yml -openapi_spec_hash: 47c828ded2fac0ded969760340b6b6fa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-07681c3b51c92b9d92d71f11e9245c37a37ac1ea6df730cd730e85968064d814.yml +openapi_spec_hash: 48bffabe129598fc41a232cf5469bd4b config_hash: 6a52f6ae7d55cf3b4e91538cc7752aeb diff --git a/LICENSE b/LICENSE index d7eaab6..507011e 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Moderation API + Copyright 2026 Moderation API Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/lib/moderation_api/models/content_submit_params.rb b/lib/moderation_api/models/content_submit_params.rb index bfe0784..1753658 100644 --- a/lib/moderation_api/models/content_submit_params.rb +++ b/lib/moderation_api/models/content_submit_params.rb @@ -834,55 +834,31 @@ class PiiMasking < ModerationAPI::Internal::Type::BaseModel # @param id [Symbol, :pii] class Entity < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::ID] - required :id, enum: -> { ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID } - # @!attribute enable # - # @return [Boolean] - required :enable, ModerationAPI::Internal::Type::Boolean + # @return [Boolean, nil] + optional :enable, ModerationAPI::Internal::Type::Boolean # @!attribute flag # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute should_mask - # - # @return [Boolean] - required :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask + # @return [Boolean, nil] + optional :flag, ModerationAPI::Internal::Type::Boolean # @!attribute mask # # @return [String, nil] optional :mask, String - # @!method initialize(id:, enable:, flag:, should_mask:, mask: nil) - # @param id [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::ID] + # @!attribute should_mask + # + # @return [Boolean, nil] + optional :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask + + # @!method initialize(enable: nil, flag: nil, mask: nil, should_mask: nil) # @param enable [Boolean] # @param flag [Boolean] - # @param should_mask [Boolean] # @param mask [String] - - # @see ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity#id - module ID - extend ModerationAPI::Internal::Type::Enum - - EMAIL = :email - PHONE = :phone - URL = :url - ADDRESS = :address - NAME = :name - USERNAME = :username - IP_ADDRESS = :ip_address - CREDIT_CARD = :credit_card - SENSITIVE_OTHER = :sensitive_other - - # @!method self.values - # @return [Array] - end + # @param should_mask [Boolean] end end @@ -903,55 +879,31 @@ class URLMasking < ModerationAPI::Internal::Type::BaseModel # @param id [Symbol, :url] class Entity < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::ID] - required :id, enum: -> { ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID } - # @!attribute enable # - # @return [Boolean] - required :enable, ModerationAPI::Internal::Type::Boolean + # @return [Boolean, nil] + optional :enable, ModerationAPI::Internal::Type::Boolean # @!attribute flag # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute should_mask - # - # @return [Boolean] - required :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask + # @return [Boolean, nil] + optional :flag, ModerationAPI::Internal::Type::Boolean # @!attribute mask # # @return [String, nil] optional :mask, String - # @!method initialize(id:, enable:, flag:, should_mask:, mask: nil) - # @param id [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::ID] + # @!attribute should_mask + # + # @return [Boolean, nil] + optional :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask + + # @!method initialize(enable: nil, flag: nil, mask: nil, should_mask: nil) # @param enable [Boolean] # @param flag [Boolean] - # @param should_mask [Boolean] # @param mask [String] - - # @see ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity#id - module ID - extend ModerationAPI::Internal::Type::Enum - - EMAIL = :email - PHONE = :phone - URL = :url - ADDRESS = :address - NAME = :name - USERNAME = :username - IP_ADDRESS = :ip_address - CREDIT_CARD = :credit_card - SENSITIVE_OTHER = :sensitive_other - - # @!method self.values - # @return [Array] - end + # @param should_mask [Boolean] end end diff --git a/rbi/moderation_api/models/content_submit_params.rbi b/rbi/moderation_api/models/content_submit_params.rbi index 8db9a0f..3a076ee 100644 --- a/rbi/moderation_api/models/content_submit_params.rbi +++ b/rbi/moderation_api/models/content_submit_params.rbi @@ -1521,21 +1521,17 @@ module ModerationAPI ) end - sig do - returns( - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::OrSymbol - ) - end - attr_accessor :id + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enable - sig { returns(T::Boolean) } - attr_accessor :enable + sig { params(enable: T::Boolean).void } + attr_writer :enable - sig { returns(T::Boolean) } - attr_accessor :flag + sig { returns(T.nilable(T::Boolean)) } + attr_reader :flag - sig { returns(T::Boolean) } - attr_accessor :should_mask + sig { params(flag: T::Boolean).void } + attr_writer :flag sig { returns(T.nilable(String)) } attr_reader :mask @@ -1543,102 +1539,35 @@ module ModerationAPI sig { params(mask: String).void } attr_writer :mask + sig { returns(T.nilable(T::Boolean)) } + attr_reader :should_mask + + sig { params(should_mask: T::Boolean).void } + attr_writer :should_mask + sig do params( - id: - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::OrSymbol, enable: T::Boolean, flag: T::Boolean, - should_mask: T::Boolean, - mask: String + mask: String, + should_mask: T::Boolean ).returns(T.attached_class) end - def self.new(id:, enable:, flag:, should_mask:, mask: nil) + def self.new(enable: nil, flag: nil, mask: nil, should_mask: nil) end sig do override.returns( { - id: - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::OrSymbol, enable: T::Boolean, flag: T::Boolean, - should_mask: T::Boolean, - mask: String + mask: String, + should_mask: T::Boolean } ) end def to_hash end - - module ID - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - EMAIL = - T.let( - :email, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - PHONE = - T.let( - :phone, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - URL = - T.let( - :url, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - ADDRESS = - T.let( - :address, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - NAME = - T.let( - :name, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - USERNAME = - T.let( - :username, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - IP_ADDRESS = - T.let( - :ip_address, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - CREDIT_CARD = - T.let( - :credit_card, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - SENSITIVE_OTHER = - T.let( - :sensitive_other, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::ID::TaggedSymbol - ] - ) - end - def self.values - end - end end end @@ -1701,21 +1630,17 @@ module ModerationAPI ) end - sig do - returns( - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::OrSymbol - ) - end - attr_accessor :id + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enable - sig { returns(T::Boolean) } - attr_accessor :enable + sig { params(enable: T::Boolean).void } + attr_writer :enable - sig { returns(T::Boolean) } - attr_accessor :flag + sig { returns(T.nilable(T::Boolean)) } + attr_reader :flag - sig { returns(T::Boolean) } - attr_accessor :should_mask + sig { params(flag: T::Boolean).void } + attr_writer :flag sig { returns(T.nilable(String)) } attr_reader :mask @@ -1723,102 +1648,35 @@ module ModerationAPI sig { params(mask: String).void } attr_writer :mask + sig { returns(T.nilable(T::Boolean)) } + attr_reader :should_mask + + sig { params(should_mask: T::Boolean).void } + attr_writer :should_mask + sig do params( - id: - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::OrSymbol, enable: T::Boolean, flag: T::Boolean, - should_mask: T::Boolean, - mask: String + mask: String, + should_mask: T::Boolean ).returns(T.attached_class) end - def self.new(id:, enable:, flag:, should_mask:, mask: nil) + def self.new(enable: nil, flag: nil, mask: nil, should_mask: nil) end sig do override.returns( { - id: - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::OrSymbol, enable: T::Boolean, flag: T::Boolean, - should_mask: T::Boolean, - mask: String + mask: String, + should_mask: T::Boolean } ) end def to_hash end - - module ID - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - EMAIL = - T.let( - :email, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - PHONE = - T.let( - :phone, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - URL = - T.let( - :url, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - ADDRESS = - T.let( - :address, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - NAME = - T.let( - :name, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - USERNAME = - T.let( - :username, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - IP_ADDRESS = - T.let( - :ip_address, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - CREDIT_CARD = - T.let( - :credit_card, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - SENSITIVE_OTHER = - T.let( - :sensitive_other, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::ID::TaggedSymbol - ] - ) - end - def self.values - end - end end end diff --git a/sig/moderation_api/models/content_submit_params.rbs b/sig/moderation_api/models/content_submit_params.rbs index 88eec43..3d3a007 100644 --- a/sig/moderation_api/models/content_submit_params.rbs +++ b/sig/moderation_api/models/content_submit_params.rbs @@ -704,69 +704,38 @@ module ModerationAPI } type entity = - { - id: ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::id, - enable: bool, - flag: bool, - should_mask: bool, - mask: String - } + { enable: bool, flag: bool, mask: String, should_mask: bool } class Entity < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::id + attr_reader enable: bool? - attr_accessor enable: bool + def enable=: (bool) -> bool - attr_accessor flag: bool + attr_reader flag: bool? - attr_accessor should_mask: bool + def flag=: (bool) -> bool attr_reader mask: String? def mask=: (String) -> String + attr_reader should_mask: bool? + + def should_mask=: (bool) -> bool + def initialize: ( - id: ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::id, - enable: bool, - flag: bool, - should_mask: bool, - ?mask: String + ?enable: bool, + ?flag: bool, + ?mask: String, + ?should_mask: bool ) -> void def to_hash: -> { - id: ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::id, enable: bool, flag: bool, - should_mask: bool, - mask: String + mask: String, + should_mask: bool } - - type id = - :email - | :phone - | :url - | :address - | :name - | :username - | :ip_address - | :credit_card - | :sensitive_other - - module ID - extend ModerationAPI::Internal::Type::Enum - - EMAIL: :email - PHONE: :phone - URL: :url - ADDRESS: :address - NAME: :name - USERNAME: :username - IP_ADDRESS: :ip_address - CREDIT_CARD: :credit_card - SENSITIVE_OTHER: :sensitive_other - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity::id] - end end end @@ -792,69 +761,38 @@ module ModerationAPI } type entity = - { - id: ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::id, - enable: bool, - flag: bool, - should_mask: bool, - mask: String - } + { enable: bool, flag: bool, mask: String, should_mask: bool } class Entity < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::id + attr_reader enable: bool? - attr_accessor enable: bool + def enable=: (bool) -> bool - attr_accessor flag: bool + attr_reader flag: bool? - attr_accessor should_mask: bool + def flag=: (bool) -> bool attr_reader mask: String? def mask=: (String) -> String + attr_reader should_mask: bool? + + def should_mask=: (bool) -> bool + def initialize: ( - id: ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::id, - enable: bool, - flag: bool, - should_mask: bool, - ?mask: String + ?enable: bool, + ?flag: bool, + ?mask: String, + ?should_mask: bool ) -> void def to_hash: -> { - id: ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::id, enable: bool, flag: bool, - should_mask: bool, - mask: String + mask: String, + should_mask: bool } - - type id = - :email - | :phone - | :url - | :address - | :name - | :username - | :ip_address - | :credit_card - | :sensitive_other - - module ID - extend ModerationAPI::Internal::Type::Enum - - EMAIL: :email - PHONE: :phone - URL: :url - ADDRESS: :address - NAME: :name - USERNAME: :username - IP_ADDRESS: :ip_address - CREDIT_CARD: :credit_card - SENSITIVE_OTHER: :sensitive_other - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity::id] - end end end From a193817382fb700d1e8f72a1a278e048a76470b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 2 Jan 2026 15:32:25 +0000 Subject: [PATCH 2/2] release: 2.3.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/moderation_api/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 89d8ff8..75ec52f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.2.1" + ".": "2.3.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 899e61d..cd0ffe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.3.0 (2026-01-02) + +Full Changelog: [v2.2.1...v2.3.0](https://github.com/moderation-api/sdk-ruby/compare/v2.2.1...v2.3.0) + +### Features + +* **api:** api update ([b7e4375](https://github.com/moderation-api/sdk-ruby/commit/b7e4375b627d949a7e9ac5794703793c9da54415)) + ## 2.2.1 (2025-12-19) Full Changelog: [v2.2.0...v2.2.1](https://github.com/moderation-api/sdk-ruby/compare/v2.2.0...v2.2.1) diff --git a/Gemfile.lock b/Gemfile.lock index dc5d4a1..13990dc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - moderation_api (2.2.1) + moderation_api (2.3.0) connection_pool GEM diff --git a/README.md b/README.md index 0a33412..497038b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "moderation_api", "~> 2.2.1" +gem "moderation_api", "~> 2.3.0" ``` diff --git a/lib/moderation_api/version.rb b/lib/moderation_api/version.rb index 9f42440..5f30aec 100644 --- a/lib/moderation_api/version.rb +++ b/lib/moderation_api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ModerationAPI - VERSION = "2.2.1" + VERSION = "2.3.0" end