From 6eb6756ef89a7b99a3825bd5ab899bf2f0b030e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 13:28:56 +0000 Subject: [PATCH 01/41] chore(tests): bump steady to v0.20.1 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 4931f304..8b82c3e5 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.7 -- steady --version + npm exec --package=@stdy/cli@0.20.1 -- steady --version - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index acff404e..da76620d 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From 4206b20a8cd60362598da173185bbd236e659eff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 19:18:31 +0000 Subject: [PATCH 02/41] chore(tests): bump steady to v0.20.2 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 8b82c3e5..886f2ffc 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.20.1 -- steady --version + npm exec --package=@stdy/cli@0.20.2 -- steady --version - npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index da76620d..9fc2510b 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From cde113151eb2879204409723971653616876fdee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 19:31:01 +0000 Subject: [PATCH 03/41] fix: variable name typo --- lib/knockapi/internal/util.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/knockapi/internal/util.rb b/lib/knockapi/internal/util.rb index c4d54820..ce7b8933 100644 --- a/lib/knockapi/internal/util.rb +++ b/lib/knockapi/internal/util.rb @@ -157,7 +157,7 @@ def coerce_hash!(input) in Hash | nil => coerced coerced else - message = "Expected a #{Hash} or #{Knockapi::Internal::Type::BaseModel}, got #{data.inspect}" + message = "Expected a #{Hash} or #{Knockapi::Internal::Type::BaseModel}, got #{input.inspect}" raise ArgumentError.new(message) end end From 3e2268d3e0547fa66ad253e35c86da963cc36215 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 20:46:12 +0000 Subject: [PATCH 04/41] fix: align path encoding with RFC 3986 section 3.3 --- lib/knockapi/internal/util.rb | 20 +++++++++++++++++--- rbi/knockapi/internal/util.rbi | 8 ++++++++ sig/knockapi/internal/util.rbs | 4 ++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/knockapi/internal/util.rb b/lib/knockapi/internal/util.rb index ce7b8933..7c80600d 100644 --- a/lib/knockapi/internal/util.rb +++ b/lib/knockapi/internal/util.rb @@ -237,6 +237,11 @@ def dig(data, pick, &blk) end end + # @type [Regexp] + # + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/ + class << self # @api private # @@ -247,6 +252,15 @@ def uri_origin(uri) "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}" end + # @api private + # + # @param path [String, Integer] + # + # @return [String] + def encode_path(path) + path.to_s.gsub(Knockapi::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) } + end + # @api private # # @param path [String, Array] @@ -259,7 +273,7 @@ def interpolate_path(path) in [] "" in [String => p, *interpolations] - encoded = interpolations.map { ERB::Util.url_encode(_1) } + encoded = interpolations.map { encode_path(_1) } format(p, *encoded) end end @@ -576,10 +590,10 @@ def encode_query_params(query) case val in Knockapi::FilePart unless val.filename.nil? - filename = ERB::Util.url_encode(val.filename) + filename = encode_path(val.filename) y << "; filename=\"#{filename}\"" in Pathname | IO - filename = ERB::Util.url_encode(::File.basename(val.to_path)) + filename = encode_path(::File.basename(val.to_path)) y << "; filename=\"#{filename}\"" else end diff --git a/rbi/knockapi/internal/util.rbi b/rbi/knockapi/internal/util.rbi index 37d976cf..680cc9ab 100644 --- a/rbi/knockapi/internal/util.rbi +++ b/rbi/knockapi/internal/util.rbi @@ -148,12 +148,20 @@ module Knockapi end end + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp) + class << self # @api private sig { params(uri: URI::Generic).returns(String) } def uri_origin(uri) end + # @api private + sig { params(path: T.any(String, Integer)).returns(String) } + def encode_path(path) + end + # @api private sig { params(path: T.any(String, T::Array[String])).returns(String) } def interpolate_path(path) diff --git a/sig/knockapi/internal/util.rbs b/sig/knockapi/internal/util.rbs index f0ea6692..486b0dcb 100644 --- a/sig/knockapi/internal/util.rbs +++ b/sig/knockapi/internal/util.rbs @@ -45,8 +45,12 @@ module Knockapi -> top? } -> top? + RFC_3986_NOT_PCHARS: Regexp + def self?.uri_origin: (URI::Generic uri) -> String + def self?.encode_path: (String | Integer path) -> String + def self?.interpolate_path: (String | ::Array[String] path) -> String def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] From 4ff46f6222b96590260445d0931a87113a51b246 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 19:44:52 +0000 Subject: [PATCH 05/41] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ac5431c0..4f3582bf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 90 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-c4b73cfc78e9b583cae6abe7c1f73caf2b81d9d8c4338819707f7089443b9754.yml -openapi_spec_hash: 8ee18f8419b62f10276dff5d35ee5f27 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-f7658bcdf4b85c3c7b283f0dc216e7eb425d4ff258674fa79f6caa0eeb340b5e.yml +openapi_spec_hash: c80f2985521f9fc3cb931940915e6a99 config_hash: 32503026a45db991d0d102f25af40a77 From 9b272e8ced5eb194a57d79ba442fba9539a0c0ef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 15:54:04 +0000 Subject: [PATCH 06/41] feat(api): added new unset preferences methods --- .stats.yml | 4 +- lib/knockapi.rb | 2 + lib/knockapi/models.rb | 4 ++ .../models/object_unset_preferences_params.rb | 32 ++++++++++++ .../models/user_unset_preferences_params.rb | 26 ++++++++++ lib/knockapi/resources/objects.rb | 24 +++++++++ lib/knockapi/resources/users.rb | 22 ++++++++ rbi/knockapi/models.rbi | 4 ++ .../object_unset_preferences_params.rbi | 51 +++++++++++++++++++ .../models/user_unset_preferences_params.rbi | 46 +++++++++++++++++ rbi/knockapi/resources/objects.rbi | 20 ++++++++ rbi/knockapi/resources/users.rbi | 17 +++++++ sig/knockapi/models.rbs | 4 ++ .../object_unset_preferences_params.rbs | 32 ++++++++++++ .../models/user_unset_preferences_params.rbs | 28 ++++++++++ sig/knockapi/resources/objects.rbs | 7 +++ sig/knockapi/resources/users.rbs | 6 +++ test/knockapi/resources/objects_test.rb | 8 +++ test/knockapi/resources/users_test.rb | 8 +++ 19 files changed, 343 insertions(+), 2 deletions(-) create mode 100644 lib/knockapi/models/object_unset_preferences_params.rb create mode 100644 lib/knockapi/models/user_unset_preferences_params.rb create mode 100644 rbi/knockapi/models/object_unset_preferences_params.rbi create mode 100644 rbi/knockapi/models/user_unset_preferences_params.rbi create mode 100644 sig/knockapi/models/object_unset_preferences_params.rbs create mode 100644 sig/knockapi/models/user_unset_preferences_params.rbs diff --git a/.stats.yml b/.stats.yml index 4f3582bf..b81442b0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 90 +configured_endpoints: 92 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-f7658bcdf4b85c3c7b283f0dc216e7eb425d4ff258674fa79f6caa0eeb340b5e.yml openapi_spec_hash: c80f2985521f9fc3cb931940915e6a99 -config_hash: 32503026a45db991d0d102f25af40a77 +config_hash: a3056fe062e62c7ca4d3931ccf3f6d06 diff --git a/lib/knockapi.rb b/lib/knockapi.rb index ea9e809e..83206a37 100644 --- a/lib/knockapi.rb +++ b/lib/knockapi.rb @@ -132,6 +132,7 @@ require_relative "knockapi/models/object_set_params" require_relative "knockapi/models/object_set_preferences_params" require_relative "knockapi/models/object_unset_channel_data_params" +require_relative "knockapi/models/object_unset_preferences_params" require_relative "knockapi/models/page_info" require_relative "knockapi/models/providers/ms_team_check_auth_params" require_relative "knockapi/models/providers/ms_team_check_auth_response" @@ -214,6 +215,7 @@ require_relative "knockapi/models/user_set_channel_data_params" require_relative "knockapi/models/user_set_preferences_params" require_relative "knockapi/models/user_unset_channel_data_params" +require_relative "knockapi/models/user_unset_preferences_params" require_relative "knockapi/models/user_update_params" require_relative "knockapi/models/workflow_cancel_params" require_relative "knockapi/models/workflow_trigger_params" diff --git a/lib/knockapi/models.rb b/lib/knockapi/models.rb index 25a828f0..bd434ea7 100644 --- a/lib/knockapi/models.rb +++ b/lib/knockapi/models.rb @@ -135,6 +135,8 @@ module Knockapi ObjectUnsetChannelDataParams = Knockapi::Models::ObjectUnsetChannelDataParams + ObjectUnsetPreferencesParams = Knockapi::Models::ObjectUnsetPreferencesParams + PageInfo = Knockapi::Models::PageInfo Providers = Knockapi::Models::Providers @@ -205,6 +207,8 @@ module Knockapi UserUnsetChannelDataParams = Knockapi::Models::UserUnsetChannelDataParams + UserUnsetPreferencesParams = Knockapi::Models::UserUnsetPreferencesParams + UserUpdateParams = Knockapi::Models::UserUpdateParams WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams diff --git a/lib/knockapi/models/object_unset_preferences_params.rb b/lib/knockapi/models/object_unset_preferences_params.rb new file mode 100644 index 00000000..f07a330d --- /dev/null +++ b/lib/knockapi/models/object_unset_preferences_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Knockapi + module Models + # @see Knockapi::Resources::Objects#unset_preferences + class ObjectUnsetPreferencesParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + # @!attribute collection + # + # @return [String] + required :collection, String + + # @!attribute object_id_ + # + # @return [String] + required :object_id_, String + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(collection:, object_id_:, id:, request_options: {}) + # @param collection [String] + # @param object_id_ [String] + # @param id [String] + # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/knockapi/models/user_unset_preferences_params.rb b/lib/knockapi/models/user_unset_preferences_params.rb new file mode 100644 index 00000000..38ef7feb --- /dev/null +++ b/lib/knockapi/models/user_unset_preferences_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Knockapi + module Models + # @see Knockapi::Resources::Users#unset_preferences + class UserUnsetPreferencesParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + # @!attribute user_id + # + # @return [String] + required :user_id, String + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(user_id:, id:, request_options: {}) + # @param user_id [String] + # @param id [String] + # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/knockapi/resources/objects.rb b/lib/knockapi/resources/objects.rb index 49786d9b..b114ba53 100644 --- a/lib/knockapi/resources/objects.rb +++ b/lib/knockapi/resources/objects.rb @@ -503,6 +503,30 @@ def unset_channel_data(collection, object_id_, channel_id, params = {}) ) end + # Unsets the preference set for the object, removing it entirely. + # + # @overload unset_preferences(collection, object_id_, id, request_options: {}) + # + # @param collection [String] The collection this object belongs to. + # + # @param object_id_ [String] Unique identifier for the object. + # + # @param id [String] Unique identifier for the preference set. + # + # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Knockapi::Models::ObjectUnsetPreferencesParams + def unset_preferences(collection, object_id_, id, params = {}) + @client.request( + method: :delete, + path: ["v1/objects/%1$s/%2$s/preferences/%3$s", collection, object_id_, id], + model: NilClass, + options: params[:request_options] + ) + end + # @api private # # @param client [Knockapi::Client] diff --git a/lib/knockapi/resources/users.rb b/lib/knockapi/resources/users.rb index b4df0367..18faf5cd 100644 --- a/lib/knockapi/resources/users.rb +++ b/lib/knockapi/resources/users.rb @@ -449,6 +449,28 @@ def unset_channel_data(user_id, channel_id, params = {}) ) end + # Unsets the preference set for the user, removing it entirely. + # + # @overload unset_preferences(user_id, id, request_options: {}) + # + # @param user_id [String] The unique identifier of the user. + # + # @param id [String] Unique identifier for the preference set. + # + # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Knockapi::Models::UserUnsetPreferencesParams + def unset_preferences(user_id, id, params = {}) + @client.request( + method: :delete, + path: ["v1/users/%1$s/preferences/%2$s", user_id, id], + model: NilClass, + options: params[:request_options] + ) + end + # @api private # # @param client [Knockapi::Client] diff --git a/rbi/knockapi/models.rbi b/rbi/knockapi/models.rbi index c9ede6d0..d80aca8f 100644 --- a/rbi/knockapi/models.rbi +++ b/rbi/knockapi/models.rbi @@ -101,6 +101,8 @@ module Knockapi ObjectUnsetChannelDataParams = Knockapi::Models::ObjectUnsetChannelDataParams + ObjectUnsetPreferencesParams = Knockapi::Models::ObjectUnsetPreferencesParams + PageInfo = Knockapi::Models::PageInfo Providers = Knockapi::Models::Providers @@ -171,6 +173,8 @@ module Knockapi UserUnsetChannelDataParams = Knockapi::Models::UserUnsetChannelDataParams + UserUnsetPreferencesParams = Knockapi::Models::UserUnsetPreferencesParams + UserUpdateParams = Knockapi::Models::UserUpdateParams WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams diff --git a/rbi/knockapi/models/object_unset_preferences_params.rbi b/rbi/knockapi/models/object_unset_preferences_params.rbi new file mode 100644 index 00000000..9badfc64 --- /dev/null +++ b/rbi/knockapi/models/object_unset_preferences_params.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module Knockapi + module Models + class ObjectUnsetPreferencesParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Knockapi::ObjectUnsetPreferencesParams, + Knockapi::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :collection + + sig { returns(String) } + attr_accessor :object_id_ + + sig { returns(String) } + attr_accessor :id + + sig do + params( + collection: String, + object_id_: String, + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(collection:, object_id_:, id:, request_options: {}) + end + + sig do + override.returns( + { + collection: String, + object_id_: String, + id: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/knockapi/models/user_unset_preferences_params.rbi b/rbi/knockapi/models/user_unset_preferences_params.rbi new file mode 100644 index 00000000..a7cda0bb --- /dev/null +++ b/rbi/knockapi/models/user_unset_preferences_params.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Knockapi + module Models + class UserUnsetPreferencesParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Knockapi::UserUnsetPreferencesParams, + Knockapi::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :user_id + + sig { returns(String) } + attr_accessor :id + + sig do + params( + user_id: String, + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(user_id:, id:, request_options: {}) + end + + sig do + override.returns( + { + user_id: String, + id: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/knockapi/resources/objects.rbi b/rbi/knockapi/resources/objects.rbi index 97d049fc..97384573 100644 --- a/rbi/knockapi/resources/objects.rbi +++ b/rbi/knockapi/resources/objects.rbi @@ -532,6 +532,26 @@ module Knockapi ) end + # Unsets the preference set for the object, removing it entirely. + sig do + params( + collection: String, + object_id_: String, + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).void + end + def unset_preferences( + # The collection this object belongs to. + collection, + # Unique identifier for the object. + object_id_, + # Unique identifier for the preference set. + id, + request_options: {} + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } def self.new(client:) diff --git a/rbi/knockapi/resources/users.rbi b/rbi/knockapi/resources/users.rbi index 6ed05eee..80f68df8 100644 --- a/rbi/knockapi/resources/users.rbi +++ b/rbi/knockapi/resources/users.rbi @@ -464,6 +464,23 @@ module Knockapi ) end + # Unsets the preference set for the user, removing it entirely. + sig do + params( + user_id: String, + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).void + end + def unset_preferences( + # The unique identifier of the user. + user_id, + # Unique identifier for the preference set. + id, + request_options: {} + ) + end + # @api private sig { params(client: Knockapi::Client).returns(T.attached_class) } def self.new(client:) diff --git a/sig/knockapi/models.rbs b/sig/knockapi/models.rbs index 7fd3a3ac..725e951a 100644 --- a/sig/knockapi/models.rbs +++ b/sig/knockapi/models.rbs @@ -95,6 +95,8 @@ module Knockapi class ObjectUnsetChannelDataParams = Knockapi::Models::ObjectUnsetChannelDataParams + class ObjectUnsetPreferencesParams = Knockapi::Models::ObjectUnsetPreferencesParams + class PageInfo = Knockapi::Models::PageInfo module Providers = Knockapi::Models::Providers @@ -165,6 +167,8 @@ module Knockapi class UserUnsetChannelDataParams = Knockapi::Models::UserUnsetChannelDataParams + class UserUnsetPreferencesParams = Knockapi::Models::UserUnsetPreferencesParams + class UserUpdateParams = Knockapi::Models::UserUpdateParams class WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams diff --git a/sig/knockapi/models/object_unset_preferences_params.rbs b/sig/knockapi/models/object_unset_preferences_params.rbs new file mode 100644 index 00000000..49d3676f --- /dev/null +++ b/sig/knockapi/models/object_unset_preferences_params.rbs @@ -0,0 +1,32 @@ +module Knockapi + module Models + type object_unset_preferences_params = + { collection: String, object_id_: String, id: String } + & Knockapi::Internal::Type::request_parameters + + class ObjectUnsetPreferencesParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + attr_accessor collection: String + + attr_accessor object_id_: String + + attr_accessor id: String + + def initialize: ( + collection: String, + object_id_: String, + id: String, + ?request_options: Knockapi::request_opts + ) -> void + + def to_hash: -> { + collection: String, + object_id_: String, + id: String, + request_options: Knockapi::RequestOptions + } + end + end +end diff --git a/sig/knockapi/models/user_unset_preferences_params.rbs b/sig/knockapi/models/user_unset_preferences_params.rbs new file mode 100644 index 00000000..36f012de --- /dev/null +++ b/sig/knockapi/models/user_unset_preferences_params.rbs @@ -0,0 +1,28 @@ +module Knockapi + module Models + type user_unset_preferences_params = + { user_id: String, id: String } + & Knockapi::Internal::Type::request_parameters + + class UserUnsetPreferencesParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + attr_accessor user_id: String + + attr_accessor id: String + + def initialize: ( + user_id: String, + id: String, + ?request_options: Knockapi::request_opts + ) -> void + + def to_hash: -> { + user_id: String, + id: String, + request_options: Knockapi::RequestOptions + } + end + end +end diff --git a/sig/knockapi/resources/objects.rbs b/sig/knockapi/resources/objects.rbs index 71d80f3e..7bd42627 100644 --- a/sig/knockapi/resources/objects.rbs +++ b/sig/knockapi/resources/objects.rbs @@ -142,6 +142,13 @@ module Knockapi ?request_options: Knockapi::request_opts ) -> nil + def unset_preferences: ( + String collection, + String object_id_, + String id, + ?request_options: Knockapi::request_opts + ) -> nil + def initialize: (client: Knockapi::Client) -> void end end diff --git a/sig/knockapi/resources/users.rbs b/sig/knockapi/resources/users.rbs index 39321e6d..1f316317 100644 --- a/sig/knockapi/resources/users.rbs +++ b/sig/knockapi/resources/users.rbs @@ -127,6 +127,12 @@ module Knockapi ?request_options: Knockapi::request_opts ) -> nil + def unset_preferences: ( + String user_id, + String id, + ?request_options: Knockapi::request_opts + ) -> nil + def initialize: (client: Knockapi::Client) -> void end end diff --git a/test/knockapi/resources/objects_test.rb b/test/knockapi/resources/objects_test.rb index d44ea708..da6524f5 100644 --- a/test/knockapi/resources/objects_test.rb +++ b/test/knockapi/resources/objects_test.rb @@ -286,4 +286,12 @@ def test_unset_channel_data response => nil end end + + def test_unset_preferences + response = @knock.objects.unset_preferences("collection", "object_id", "default") + + assert_pattern do + response => nil + end + end end diff --git a/test/knockapi/resources/users_test.rb b/test/knockapi/resources/users_test.rb index c4b25eeb..44bd2037 100644 --- a/test/knockapi/resources/users_test.rb +++ b/test/knockapi/resources/users_test.rb @@ -298,4 +298,12 @@ def test_unset_channel_data response => nil end end + + def test_unset_preferences + response = @knock.users.unset_preferences("user_id", "default") + + assert_pattern do + response => nil + end + end end From f710ae264c9e1acdcf36b41b93e49cd7a8ebaf12 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:09:11 +0000 Subject: [PATCH 07/41] feat(api): api update --- .stats.yml | 4 ++-- .../models/users/guide_get_channel_response.rb | 10 +++++++++- .../models/users/guide_get_channel_response.rbi | 11 +++++++++++ .../models/users/guide_get_channel_response.rbs | 7 +++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index b81442b0..f2a12050 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-f7658bcdf4b85c3c7b283f0dc216e7eb425d4ff258674fa79f6caa0eeb340b5e.yml -openapi_spec_hash: c80f2985521f9fc3cb931940915e6a99 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-9424b756f0a9438c5869b404da1779095190ea58a215179b29bef2b8cb65b106.yml +openapi_spec_hash: 9adf51786e9a57c01a0c29710ff70f95 config_hash: a3056fe062e62c7ca4d3931ccf3f6d06 diff --git a/lib/knockapi/models/users/guide_get_channel_response.rb b/lib/knockapi/models/users/guide_get_channel_response.rb index c3006989..96c7eddf 100644 --- a/lib/knockapi/models/users/guide_get_channel_response.rb +++ b/lib/knockapi/models/users/guide_get_channel_response.rb @@ -88,6 +88,12 @@ class Entry < Knockapi::Internal::Type::BaseModel # @return [String, nil] optional :channel_id, String + # @!attribute dashboard_url + # URL to this guide in the Knock dashboard + # + # @return [String, nil] + optional :dashboard_url, String + # @!attribute inserted_at # # @return [Time, nil] @@ -121,7 +127,7 @@ class Entry < Knockapi::Internal::Type::BaseModel # @return [Time, nil] optional :updated_at, Time - # @!method initialize(id: nil, _typename: nil, activation_url_patterns: nil, activation_url_rules: nil, active: nil, bypass_global_group_limit: nil, channel_id: nil, inserted_at: nil, key: nil, semver: nil, steps: nil, type: nil, updated_at: nil) + # @!method initialize(id: nil, _typename: nil, activation_url_patterns: nil, activation_url_rules: nil, active: nil, bypass_global_group_limit: nil, channel_id: nil, dashboard_url: nil, inserted_at: nil, key: nil, semver: nil, steps: nil, type: nil, updated_at: nil) # Some parameter documentations has been truncated, see # {Knockapi::Models::Users::GuideGetChannelResponse::Entry} for more details. # @@ -139,6 +145,8 @@ class Entry < Knockapi::Internal::Type::BaseModel # # @param channel_id [String] # + # @param dashboard_url [String] URL to this guide in the Knock dashboard + # # @param inserted_at [Time] # # @param key [String] The key of the guide. diff --git a/rbi/knockapi/models/users/guide_get_channel_response.rbi b/rbi/knockapi/models/users/guide_get_channel_response.rbi index 4c546889..d30d11d2 100644 --- a/rbi/knockapi/models/users/guide_get_channel_response.rbi +++ b/rbi/knockapi/models/users/guide_get_channel_response.rbi @@ -184,6 +184,13 @@ module Knockapi sig { params(channel_id: String).void } attr_writer :channel_id + # URL to this guide in the Knock dashboard + sig { returns(T.nilable(String)) } + attr_reader :dashboard_url + + sig { params(dashboard_url: String).void } + attr_writer :dashboard_url + sig { returns(T.nilable(Time)) } attr_reader :inserted_at @@ -252,6 +259,7 @@ module Knockapi active: T::Boolean, bypass_global_group_limit: T::Boolean, channel_id: String, + dashboard_url: String, inserted_at: Time, key: String, semver: String, @@ -278,6 +286,8 @@ module Knockapi active: nil, bypass_global_group_limit: nil, channel_id: nil, + # URL to this guide in the Knock dashboard + dashboard_url: nil, inserted_at: nil, # The key of the guide. key: nil, @@ -305,6 +315,7 @@ module Knockapi active: T::Boolean, bypass_global_group_limit: T::Boolean, channel_id: String, + dashboard_url: String, inserted_at: Time, key: String, semver: String, diff --git a/sig/knockapi/models/users/guide_get_channel_response.rbs b/sig/knockapi/models/users/guide_get_channel_response.rbs index f2dbaae6..79ca3503 100644 --- a/sig/knockapi/models/users/guide_get_channel_response.rbs +++ b/sig/knockapi/models/users/guide_get_channel_response.rbs @@ -41,6 +41,7 @@ module Knockapi active: bool, bypass_global_group_limit: bool, channel_id: String, + dashboard_url: String, inserted_at: Time, key: String, semver: String, @@ -82,6 +83,10 @@ module Knockapi def channel_id=: (String) -> String + attr_reader dashboard_url: String? + + def dashboard_url=: (String) -> String + attr_reader inserted_at: Time? def inserted_at=: (Time) -> Time @@ -116,6 +121,7 @@ module Knockapi ?active: bool, ?bypass_global_group_limit: bool, ?channel_id: String, + ?dashboard_url: String, ?inserted_at: Time, ?key: String, ?semver: String, @@ -132,6 +138,7 @@ module Knockapi active: bool, bypass_global_group_limit: bool, channel_id: String, + dashboard_url: String, inserted_at: Time, key: String, semver: String, From 0715076b3cb219501a9bedd7a449f4cedef2babb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 20:03:55 +0000 Subject: [PATCH 08/41] fix: multipart encoding for file arrays --- lib/knockapi/internal/util.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/knockapi/internal/util.rb b/lib/knockapi/internal/util.rb index 7c80600d..24ef15bf 100644 --- a/lib/knockapi/internal/util.rb +++ b/lib/knockapi/internal/util.rb @@ -610,6 +610,7 @@ def encode_query_params(query) # # @return [Array(String, Enumerable)] private def encode_multipart_streaming(body) + # rubocop:disable Style/CaseEquality # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length boundary = SecureRandom.urlsafe_base64(46) @@ -619,7 +620,7 @@ def encode_query_params(query) in Hash body.each do |key, val| case val - in Array if val.all? { primitive?(_1) } + in Array if val.all? { primitive?(_1) || Knockapi::Internal::Type::FileInput === _1 } val.each do |v| write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing) end @@ -635,6 +636,7 @@ def encode_query_params(query) fused_io = fused_enum(strio) { closing.each(&:call) } [boundary, fused_io] + # rubocop:enable Style/CaseEquality end # @api private From 35446791c2f0779b17348e4eb7be78db2f0f9970 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 17:09:47 +0000 Subject: [PATCH 09/41] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f2a12050..30151525 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-9424b756f0a9438c5869b404da1779095190ea58a215179b29bef2b8cb65b106.yml -openapi_spec_hash: 9adf51786e9a57c01a0c29710ff70f95 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-3e8f3a4664d48b3d546339018b451a356f8e20c223a2d21e7c3824fad4cddc7b.yml +openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 config_hash: a3056fe062e62c7ca4d3931ccf3f6d06 From 52fa84de3f52f70ca5744cbd80ecdf2902a2133e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:03:16 +0000 Subject: [PATCH 10/41] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 30151525..f2a12050 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-3e8f3a4664d48b3d546339018b451a356f8e20c223a2d21e7c3824fad4cddc7b.yml -openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-9424b756f0a9438c5869b404da1779095190ea58a215179b29bef2b8cb65b106.yml +openapi_spec_hash: 9adf51786e9a57c01a0c29710ff70f95 config_hash: a3056fe062e62c7ca4d3931ccf3f6d06 From e75ece07830058e3118eeedb63e713c64981d5b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 16:28:35 +0000 Subject: [PATCH 11/41] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f2a12050..71d9096a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-9424b756f0a9438c5869b404da1779095190ea58a215179b29bef2b8cb65b106.yml -openapi_spec_hash: 9adf51786e9a57c01a0c29710ff70f95 +openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 config_hash: a3056fe062e62c7ca4d3931ccf3f6d06 From cf7ad986fdc61d37c36507d82cf792cf1ceab303 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 19:47:03 +0000 Subject: [PATCH 12/41] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 71d9096a..30151525 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-9424b756f0a9438c5869b404da1779095190ea58a215179b29bef2b8cb65b106.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-3e8f3a4664d48b3d546339018b451a356f8e20c223a2d21e7c3824fad4cddc7b.yml openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 config_hash: a3056fe062e62c7ca4d3931ccf3f6d06 From 5b37b2467d9d996161d02d5df3bbdf703f51bad7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 19:52:19 +0000 Subject: [PATCH 13/41] chore(tests): bump steady to v0.22.1 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 886f2ffc..04d29019 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.20.2 -- steady --version + npm exec --package=@stdy/cli@0.22.1 -- steady --version - npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 9fc2510b..ad94c14b 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From 1e34f54ffff850939a1effd58cb9711b442d7a93 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 14:13:48 +0000 Subject: [PATCH 14/41] feat(KNO-12791): Add workflow recipient run APIs --- .stats.yml | 4 +- lib/knockapi.rb | 6 + lib/knockapi/client.rb | 6 + lib/knockapi/models.rb | 10 + lib/knockapi/models/workflow_recipient_run.rb | 192 +++++++++++ .../models/workflow_recipient_run_detail.rb | 19 ++ .../models/workflow_recipient_run_event.rb | 99 ++++++ .../workflow_recipient_run_get_params.rb | 20 ++ .../workflow_recipient_run_list_params.rb | 112 +++++++ .../resources/workflow_recipient_runs.rb | 81 +++++ rbi/knockapi/client.rbi | 5 + rbi/knockapi/models.rbi | 12 + .../models/workflow_recipient_run.rbi | 311 ++++++++++++++++++ .../models/workflow_recipient_run_detail.rbi | 39 +++ .../models/workflow_recipient_run_event.rbi | 137 ++++++++ .../workflow_recipient_run_get_params.rbi | 38 +++ .../workflow_recipient_run_list_params.rbi | 229 +++++++++++++ .../resources/workflow_recipient_runs.rbi | 79 +++++ sig/knockapi/client.rbs | 2 + sig/knockapi/models.rbs | 10 + .../models/workflow_recipient_run.rbs | 146 ++++++++ .../models/workflow_recipient_run_detail.rbs | 20 ++ .../models/workflow_recipient_run_event.rbs | 73 ++++ .../workflow_recipient_run_get_params.rbs | 20 ++ .../workflow_recipient_run_list_params.rbs | 109 ++++++ .../resources/workflow_recipient_runs.rbs | 26 ++ .../resources/workflow_recipient_runs_test.rb | 45 +++ 27 files changed, 1848 insertions(+), 2 deletions(-) create mode 100644 lib/knockapi/models/workflow_recipient_run.rb create mode 100644 lib/knockapi/models/workflow_recipient_run_detail.rb create mode 100644 lib/knockapi/models/workflow_recipient_run_event.rb create mode 100644 lib/knockapi/models/workflow_recipient_run_get_params.rb create mode 100644 lib/knockapi/models/workflow_recipient_run_list_params.rb create mode 100644 lib/knockapi/resources/workflow_recipient_runs.rb create mode 100644 rbi/knockapi/models/workflow_recipient_run.rbi create mode 100644 rbi/knockapi/models/workflow_recipient_run_detail.rbi create mode 100644 rbi/knockapi/models/workflow_recipient_run_event.rbi create mode 100644 rbi/knockapi/models/workflow_recipient_run_get_params.rbi create mode 100644 rbi/knockapi/models/workflow_recipient_run_list_params.rbi create mode 100644 rbi/knockapi/resources/workflow_recipient_runs.rbi create mode 100644 sig/knockapi/models/workflow_recipient_run.rbs create mode 100644 sig/knockapi/models/workflow_recipient_run_detail.rbs create mode 100644 sig/knockapi/models/workflow_recipient_run_event.rbs create mode 100644 sig/knockapi/models/workflow_recipient_run_get_params.rbs create mode 100644 sig/knockapi/models/workflow_recipient_run_list_params.rbs create mode 100644 sig/knockapi/resources/workflow_recipient_runs.rbs create mode 100644 test/knockapi/resources/workflow_recipient_runs_test.rb diff --git a/.stats.yml b/.stats.yml index 30151525..0299b17b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 92 +configured_endpoints: 94 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-3e8f3a4664d48b3d546339018b451a356f8e20c223a2d21e7c3824fad4cddc7b.yml openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 -config_hash: a3056fe062e62c7ca4d3931ccf3f6d06 +config_hash: 2008af3064bfaa2ba7828708de5d97a8 diff --git a/lib/knockapi.rb b/lib/knockapi.rb index 83206a37..937252f4 100644 --- a/lib/knockapi.rb +++ b/lib/knockapi.rb @@ -59,6 +59,7 @@ require_relative "knockapi/models/recipients/channel_data_request" require_relative "knockapi/models/recipients/preference_set_request" require_relative "knockapi/models/identify_user_request" +require_relative "knockapi/models/workflow_recipient_run" require_relative "knockapi/models/activity" require_relative "knockapi/models/audience_add_members_params" require_relative "knockapi/models/audience_list_members_params" @@ -218,6 +219,10 @@ require_relative "knockapi/models/user_unset_preferences_params" require_relative "knockapi/models/user_update_params" require_relative "knockapi/models/workflow_cancel_params" +require_relative "knockapi/models/workflow_recipient_run_detail" +require_relative "knockapi/models/workflow_recipient_run_event" +require_relative "knockapi/models/workflow_recipient_run_get_params" +require_relative "knockapi/models/workflow_recipient_run_list_params" require_relative "knockapi/models/workflow_trigger_params" require_relative "knockapi/models/workflow_trigger_response" require_relative "knockapi/models" @@ -247,4 +252,5 @@ require_relative "knockapi/resources/users/bulk" require_relative "knockapi/resources/users/feeds" require_relative "knockapi/resources/users/guides" +require_relative "knockapi/resources/workflow_recipient_runs" require_relative "knockapi/resources/workflows" diff --git a/lib/knockapi/client.rb b/lib/knockapi/client.rb index c5d7fb5d..7fed4331 100644 --- a/lib/knockapi/client.rb +++ b/lib/knockapi/client.rb @@ -59,6 +59,11 @@ class Client < Knockapi::Internal::Transport::BaseClient # @return [Knockapi::Resources::Workflows] attr_reader :workflows + # A workflow run represents an individual execution of a workflow for a specific + # recipient. + # @return [Knockapi::Resources::WorkflowRecipientRuns] + attr_reader :workflow_recipient_runs + # A schedule is a per-recipient, timezone-aware configuration for when to invoke a # workflow. # @return [Knockapi::Resources::Schedules] @@ -139,6 +144,7 @@ def initialize( @providers = Knockapi::Resources::Providers.new(client: self) @integrations = Knockapi::Resources::Integrations.new(client: self) @workflows = Knockapi::Resources::Workflows.new(client: self) + @workflow_recipient_runs = Knockapi::Resources::WorkflowRecipientRuns.new(client: self) @schedules = Knockapi::Resources::Schedules.new(client: self) @channels = Knockapi::Resources::Channels.new(client: self) @audiences = Knockapi::Resources::Audiences.new(client: self) diff --git a/lib/knockapi/models.rb b/lib/knockapi/models.rb index bd434ea7..bada9db5 100644 --- a/lib/knockapi/models.rb +++ b/lib/knockapi/models.rb @@ -213,5 +213,15 @@ module Knockapi WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams + WorkflowRecipientRun = Knockapi::Models::WorkflowRecipientRun + + WorkflowRecipientRunDetail = Knockapi::Models::WorkflowRecipientRunDetail + + WorkflowRecipientRunEvent = Knockapi::Models::WorkflowRecipientRunEvent + + WorkflowRecipientRunGetParams = Knockapi::Models::WorkflowRecipientRunGetParams + + WorkflowRecipientRunListParams = Knockapi::Models::WorkflowRecipientRunListParams + WorkflowTriggerParams = Knockapi::Models::WorkflowTriggerParams end diff --git a/lib/knockapi/models/workflow_recipient_run.rb b/lib/knockapi/models/workflow_recipient_run.rb new file mode 100644 index 00000000..b2c72feb --- /dev/null +++ b/lib/knockapi/models/workflow_recipient_run.rb @@ -0,0 +1,192 @@ +# frozen_string_literal: true + +module Knockapi + module Models + # @see Knockapi::Resources::WorkflowRecipientRuns#list + class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the workflow recipient run (per-recipient). + # + # @return [String] + required :id, String + + # @!attribute _typename + # The typename of the schema. + # + # @return [String] + required :_typename, String, api_name: :__typename + + # @!attribute inserted_at + # Timestamp when the resource was created. + # + # @return [Time] + required :inserted_at, Time + + # @!attribute recipient + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). + # + # @return [String, Knockapi::Models::RecipientReference::ObjectReference] + required :recipient, union: -> { Knockapi::RecipientReference } + + # @!attribute status + # The current status of the workflow recipient run. One of `queued`, `processing`, + # `paused`, `completed`, or `cancelled`. + # + # @return [Symbol, Knockapi::Models::WorkflowRecipientRun::Status] + required :status, enum: -> { Knockapi::WorkflowRecipientRun::Status } + + # @!attribute trigger_source + # Describes how the workflow was triggered. + # + # @return [Knockapi::Models::WorkflowRecipientRun::TriggerSource] + required :trigger_source, -> { Knockapi::WorkflowRecipientRun::TriggerSource } + + # @!attribute updated_at + # The timestamp when the resource was last updated. + # + # @return [Time] + required :updated_at, Time + + # @!attribute workflow + # The key of the workflow that was executed. + # + # @return [String] + required :workflow, String + + # @!attribute workflow_run_id + # The identifier for the top-level workflow run shared across all recipients in a + # single trigger. + # + # @return [String] + required :workflow_run_id, String + + # @!attribute actor + # A recipient of a notification, which is either a user or an object. + # + # @return [Knockapi::Models::User, Knockapi::Models::Object, nil] + optional :actor, union: -> { Knockapi::Recipient }, nil?: true + + # @!attribute error_count + # The number of errors encountered during the workflow recipient run. + # + # @return [Integer, nil] + optional :error_count, Integer + + # @!attribute tenant + # The tenant associated with the workflow recipient run. + # + # @return [String, nil] + optional :tenant, String, nil?: true + + # @!method initialize(id:, _typename:, inserted_at:, recipient:, status:, trigger_source:, updated_at:, workflow:, workflow_run_id:, actor: nil, error_count: nil, tenant: nil) + # Some parameter documentations has been truncated, see + # {Knockapi::Models::WorkflowRecipientRun} for more details. + # + # A workflow recipient run represents an individual execution of a workflow for a + # specific recipient. + # + # @param id [String] The unique identifier for the workflow recipient run (per-recipient). + # + # @param _typename [String] The typename of the schema. + # + # @param inserted_at [Time] Timestamp when the resource was created. + # + # @param recipient [String, Knockapi::Models::RecipientReference::ObjectReference] A reference to a recipient, either a user identifier (string) or an object refer + # + # @param status [Symbol, Knockapi::Models::WorkflowRecipientRun::Status] The current status of the workflow recipient run. One of `queued`, `processing`, + # + # @param trigger_source [Knockapi::Models::WorkflowRecipientRun::TriggerSource] Describes how the workflow was triggered. + # + # @param updated_at [Time] The timestamp when the resource was last updated. + # + # @param workflow [String] The key of the workflow that was executed. + # + # @param workflow_run_id [String] The identifier for the top-level workflow run shared across all recipients in a + # + # @param actor [Knockapi::Models::User, Knockapi::Models::Object, nil] A recipient of a notification, which is either a user or an object. + # + # @param error_count [Integer] The number of errors encountered during the workflow recipient run. + # + # @param tenant [String, nil] The tenant associated with the workflow recipient run. + + # The current status of the workflow recipient run. One of `queued`, `processing`, + # `paused`, `completed`, or `cancelled`. + # + # @see Knockapi::Models::WorkflowRecipientRun#status + module Status + extend Knockapi::Internal::Type::Enum + + QUEUED = :queued + PROCESSING = :processing + PAUSED = :paused + COMPLETED = :completed + CANCELLED = :cancelled + + # @!method self.values + # @return [Array] + end + + # @see Knockapi::Models::WorkflowRecipientRun#trigger_source + class TriggerSource < Knockapi::Internal::Type::BaseModel + # @!attribute type + # The type of trigger source. One of `api`, `audience`, `schedule`, `broadcast`, + # `workflow_step`, `integration`, or `rehearsal`. + # + # @return [Symbol, Knockapi::Models::WorkflowRecipientRun::TriggerSource::Type] + required :type, enum: -> { Knockapi::WorkflowRecipientRun::TriggerSource::Type } + + # @!attribute audience_key + # The key of the audience that triggered the workflow. + # + # @return [String, nil] + optional :audience_key, String, nil?: true + + # @!attribute cancellation_key + # The cancellation key provided when the workflow was triggered via the API. + # + # @return [String, nil] + optional :cancellation_key, String, nil?: true + + # @!attribute schedule_id + # The ID of the schedule that triggered the workflow. + # + # @return [String, nil] + optional :schedule_id, String, nil?: true + + # @!method initialize(type:, audience_key: nil, cancellation_key: nil, schedule_id: nil) + # Some parameter documentations has been truncated, see + # {Knockapi::Models::WorkflowRecipientRun::TriggerSource} for more details. + # + # Describes how the workflow was triggered. + # + # @param type [Symbol, Knockapi::Models::WorkflowRecipientRun::TriggerSource::Type] The type of trigger source. One of `api`, `audience`, `schedule`, `broadcast`, ` + # + # @param audience_key [String, nil] The key of the audience that triggered the workflow. + # + # @param cancellation_key [String, nil] The cancellation key provided when the workflow was triggered via the API. + # + # @param schedule_id [String, nil] The ID of the schedule that triggered the workflow. + + # The type of trigger source. One of `api`, `audience`, `schedule`, `broadcast`, + # `workflow_step`, `integration`, or `rehearsal`. + # + # @see Knockapi::Models::WorkflowRecipientRun::TriggerSource#type + module Type + extend Knockapi::Internal::Type::Enum + + API = :api + AUDIENCE = :audience + SCHEDULE = :schedule + BROADCAST = :broadcast + WORKFLOW_STEP = :workflow_step + INTEGRATION = :integration + REHEARSAL = :rehearsal + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/knockapi/models/workflow_recipient_run_detail.rb b/lib/knockapi/models/workflow_recipient_run_detail.rb new file mode 100644 index 00000000..d124a59d --- /dev/null +++ b/lib/knockapi/models/workflow_recipient_run_detail.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Knockapi + module Models + # @see Knockapi::Resources::WorkflowRecipientRuns#get + class WorkflowRecipientRunDetail < Knockapi::Models::WorkflowRecipientRun + # @!attribute events + # A list of events that occurred during the workflow recipient run. + # + # @return [Array] + required :events, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::WorkflowRecipientRunEvent] } + + # @!method initialize(events:) + # A single workflow recipient run with its events. + # + # @param events [Array] A list of events that occurred during the workflow recipient run. + end + end +end diff --git a/lib/knockapi/models/workflow_recipient_run_event.rb b/lib/knockapi/models/workflow_recipient_run_event.rb new file mode 100644 index 00000000..c1686318 --- /dev/null +++ b/lib/knockapi/models/workflow_recipient_run_event.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Knockapi + module Models + class WorkflowRecipientRunEvent < Knockapi::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the event. + # + # @return [String] + required :id, String + + # @!attribute _typename + # The typename of the schema. + # + # @return [String] + required :_typename, String, api_name: :__typename + + # @!attribute event + # The type of event that occurred. + # + # @return [String] + required :event, String + + # @!attribute inserted_at + # Timestamp when the resource was created. + # + # @return [Time] + required :inserted_at, Time + + # @!attribute status + # Whether the event represents a successful or error state. + # + # @return [Symbol, Knockapi::Models::WorkflowRecipientRunEvent::Status] + required :status, enum: -> { Knockapi::WorkflowRecipientRunEvent::Status } + + # @!attribute attempt + # The attempt number of the workflow recipient run event. Increments for each + # retry. + # + # @return [Integer, nil] + optional :attempt, Integer + + # @!attribute data + # Event-specific data associated with the event. + # + # @return [Hash{Symbol=>Object}, nil] + optional :data, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true + + # @!attribute step_ref + # The reference of the workflow step associated with this event. + # + # @return [String, nil] + optional :step_ref, String, nil?: true + + # @!attribute step_type + # The type of workflow step associated with this event. + # + # @return [String, nil] + optional :step_type, String, nil?: true + + # @!method initialize(id:, _typename:, event:, inserted_at:, status:, attempt: nil, data: nil, step_ref: nil, step_type: nil) + # Some parameter documentations has been truncated, see + # {Knockapi::Models::WorkflowRecipientRunEvent} for more details. + # + # An event that occurred during a workflow recipient run. + # + # @param id [String] The unique identifier for the event. + # + # @param _typename [String] The typename of the schema. + # + # @param event [String] The type of event that occurred. + # + # @param inserted_at [Time] Timestamp when the resource was created. + # + # @param status [Symbol, Knockapi::Models::WorkflowRecipientRunEvent::Status] Whether the event represents a successful or error state. + # + # @param attempt [Integer] The attempt number of the workflow recipient run event. Increments for each retr + # + # @param data [Hash{Symbol=>Object}, nil] Event-specific data associated with the event. + # + # @param step_ref [String, nil] The reference of the workflow step associated with this event. + # + # @param step_type [String, nil] The type of workflow step associated with this event. + + # Whether the event represents a successful or error state. + # + # @see Knockapi::Models::WorkflowRecipientRunEvent#status + module Status + extend Knockapi::Internal::Type::Enum + + OK = :ok + ERROR = :error + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/knockapi/models/workflow_recipient_run_get_params.rb b/lib/knockapi/models/workflow_recipient_run_get_params.rb new file mode 100644 index 00000000..f009524a --- /dev/null +++ b/lib/knockapi/models/workflow_recipient_run_get_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Knockapi + module Models + # @see Knockapi::Resources::WorkflowRecipientRuns#get + class WorkflowRecipientRunGetParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/knockapi/models/workflow_recipient_run_list_params.rb b/lib/knockapi/models/workflow_recipient_run_list_params.rb new file mode 100644 index 00000000..e9ebedc0 --- /dev/null +++ b/lib/knockapi/models/workflow_recipient_run_list_params.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +module Knockapi + module Models + # @see Knockapi::Resources::WorkflowRecipientRuns#list + class WorkflowRecipientRunListParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + # @!attribute after + # The cursor to fetch entries after. + # + # @return [String, nil] + optional :after, String + + # @!attribute before + # The cursor to fetch entries before. + # + # @return [String, nil] + optional :before, String + + # @!attribute ending_at + # Limits the results to workflow recipient runs started before the given date. + # + # @return [Time, nil] + optional :ending_at, Time + + # @!attribute has_errors + # Limits the results to workflow recipient runs that have errors. + # + # @return [Boolean, nil] + optional :has_errors, Knockapi::Internal::Type::Boolean + + # @!attribute page_size + # The number of items per page (defaults to 50). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute recipient + # Limits the results to workflow recipient runs for the given recipient. Accepts a + # user ID string or an object reference with `id` and `collection`. + # + # @return [String, Knockapi::Models::RecipientReference::ObjectReference, nil] + optional :recipient, union: -> { Knockapi::RecipientReference } + + # @!attribute starting_at + # Limits the results to workflow recipient runs started after the given date. + # + # @return [Time, nil] + optional :starting_at, Time + + # @!attribute status + # Limits the results to workflow recipient runs with the given status. + # + # @return [Array, nil] + optional :status, + -> { Knockapi::Internal::Type::ArrayOf[enum: Knockapi::WorkflowRecipientRunListParams::Status] } + + # @!attribute tenant + # Limits the results to workflow recipient runs for the given tenant. + # + # @return [String, nil] + optional :tenant, String + + # @!attribute workflow + # Limits the results to workflow recipient runs for the given workflow key. + # + # @return [String, nil] + optional :workflow, String + + # @!method initialize(after: nil, before: nil, ending_at: nil, has_errors: nil, page_size: nil, recipient: nil, starting_at: nil, status: nil, tenant: nil, workflow: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Knockapi::Models::WorkflowRecipientRunListParams} for more details. + # + # @param after [String] The cursor to fetch entries after. + # + # @param before [String] The cursor to fetch entries before. + # + # @param ending_at [Time] Limits the results to workflow recipient runs started before the given date. + # + # @param has_errors [Boolean] Limits the results to workflow recipient runs that have errors. + # + # @param page_size [Integer] The number of items per page (defaults to 50). + # + # @param recipient [String, Knockapi::Models::RecipientReference::ObjectReference] Limits the results to workflow recipient runs for the given recipient. Accepts a + # + # @param starting_at [Time] Limits the results to workflow recipient runs started after the given date. + # + # @param status [Array] Limits the results to workflow recipient runs with the given status. + # + # @param tenant [String] Limits the results to workflow recipient runs for the given tenant. + # + # @param workflow [String] Limits the results to workflow recipient runs for the given workflow key. + # + # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}] + + module Status + extend Knockapi::Internal::Type::Enum + + QUEUED = :queued + PROCESSING = :processing + PAUSED = :paused + COMPLETED = :completed + CANCELLED = :cancelled + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/knockapi/resources/workflow_recipient_runs.rb b/lib/knockapi/resources/workflow_recipient_runs.rb new file mode 100644 index 00000000..6033692d --- /dev/null +++ b/lib/knockapi/resources/workflow_recipient_runs.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module Knockapi + module Resources + # A workflow run represents an individual execution of a workflow for a specific + # recipient. + class WorkflowRecipientRuns + # Some parameter documentations has been truncated, see + # {Knockapi::Models::WorkflowRecipientRunListParams} for more details. + # + # Returns a paginated list of workflow recipient runs for the current environment. + # + # @overload list(after: nil, before: nil, ending_at: nil, has_errors: nil, page_size: nil, recipient: nil, starting_at: nil, status: nil, tenant: nil, workflow: nil, request_options: {}) + # + # @param after [String] The cursor to fetch entries after. + # + # @param before [String] The cursor to fetch entries before. + # + # @param ending_at [Time] Limits the results to workflow recipient runs started before the given date. + # + # @param has_errors [Boolean] Limits the results to workflow recipient runs that have errors. + # + # @param page_size [Integer] The number of items per page (defaults to 50). + # + # @param recipient [String, Knockapi::Models::RecipientReference::ObjectReference] Limits the results to workflow recipient runs for the given recipient. Accepts a + # + # @param starting_at [Time] Limits the results to workflow recipient runs started after the given date. + # + # @param status [Array] Limits the results to workflow recipient runs with the given status. + # + # @param tenant [String] Limits the results to workflow recipient runs for the given tenant. + # + # @param workflow [String] Limits the results to workflow recipient runs for the given workflow key. + # + # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Knockapi::Internal::ItemsCursor] + # + # @see Knockapi::Models::WorkflowRecipientRunListParams + def list(params = {}) + parsed, options = Knockapi::WorkflowRecipientRunListParams.dump_request(params) + query = Knockapi::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/workflow_recipient_runs", + query: query, + page: Knockapi::Internal::ItemsCursor, + model: Knockapi::WorkflowRecipientRun, + options: options + ) + end + + # Returns a single workflow recipient run with its associated events. + # + # @overload get(id, request_options: {}) + # + # @param id [String] The unique identifier for the workflow recipient run (per-recipient). + # + # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Knockapi::Models::WorkflowRecipientRunDetail] + # + # @see Knockapi::Models::WorkflowRecipientRunGetParams + def get(id, params = {}) + @client.request( + method: :get, + path: ["v1/workflow_recipient_runs/%1$s", id], + model: Knockapi::WorkflowRecipientRunDetail, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Knockapi::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/rbi/knockapi/client.rbi b/rbi/knockapi/client.rbi index bc2f5dcf..40bd8d6b 100644 --- a/rbi/knockapi/client.rbi +++ b/rbi/knockapi/client.rbi @@ -54,6 +54,11 @@ module Knockapi sig { returns(Knockapi::Resources::Workflows) } attr_reader :workflows + # A workflow run represents an individual execution of a workflow for a specific + # recipient. + sig { returns(Knockapi::Resources::WorkflowRecipientRuns) } + attr_reader :workflow_recipient_runs + # A schedule is a per-recipient, timezone-aware configuration for when to invoke a # workflow. sig { returns(Knockapi::Resources::Schedules) } diff --git a/rbi/knockapi/models.rbi b/rbi/knockapi/models.rbi index d80aca8f..9333227f 100644 --- a/rbi/knockapi/models.rbi +++ b/rbi/knockapi/models.rbi @@ -179,5 +179,17 @@ module Knockapi WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams + WorkflowRecipientRun = Knockapi::Models::WorkflowRecipientRun + + WorkflowRecipientRunDetail = Knockapi::Models::WorkflowRecipientRunDetail + + WorkflowRecipientRunEvent = Knockapi::Models::WorkflowRecipientRunEvent + + WorkflowRecipientRunGetParams = + Knockapi::Models::WorkflowRecipientRunGetParams + + WorkflowRecipientRunListParams = + Knockapi::Models::WorkflowRecipientRunListParams + WorkflowTriggerParams = Knockapi::Models::WorkflowTriggerParams end diff --git a/rbi/knockapi/models/workflow_recipient_run.rbi b/rbi/knockapi/models/workflow_recipient_run.rbi new file mode 100644 index 00000000..3cea8be6 --- /dev/null +++ b/rbi/knockapi/models/workflow_recipient_run.rbi @@ -0,0 +1,311 @@ +# typed: strong + +module Knockapi + module Models + class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Knockapi::WorkflowRecipientRun, Knockapi::Internal::AnyHash) + end + + # The unique identifier for the workflow recipient run (per-recipient). + sig { returns(String) } + attr_accessor :id + + # The typename of the schema. + sig { returns(String) } + attr_accessor :_typename + + # Timestamp when the resource was created. + sig { returns(Time) } + attr_accessor :inserted_at + + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). + sig { returns(Knockapi::RecipientReference::Variants) } + attr_accessor :recipient + + # The current status of the workflow recipient run. One of `queued`, `processing`, + # `paused`, `completed`, or `cancelled`. + sig { returns(Knockapi::WorkflowRecipientRun::Status::TaggedSymbol) } + attr_accessor :status + + # Describes how the workflow was triggered. + sig { returns(Knockapi::WorkflowRecipientRun::TriggerSource) } + attr_reader :trigger_source + + sig do + params( + trigger_source: Knockapi::WorkflowRecipientRun::TriggerSource::OrHash + ).void + end + attr_writer :trigger_source + + # The timestamp when the resource was last updated. + sig { returns(Time) } + attr_accessor :updated_at + + # The key of the workflow that was executed. + sig { returns(String) } + attr_accessor :workflow + + # The identifier for the top-level workflow run shared across all recipients in a + # single trigger. + sig { returns(String) } + attr_accessor :workflow_run_id + + # A recipient of a notification, which is either a user or an object. + sig { returns(T.nilable(Knockapi::Recipient::Variants)) } + attr_accessor :actor + + # The number of errors encountered during the workflow recipient run. + sig { returns(T.nilable(Integer)) } + attr_reader :error_count + + sig { params(error_count: Integer).void } + attr_writer :error_count + + # The tenant associated with the workflow recipient run. + sig { returns(T.nilable(String)) } + attr_accessor :tenant + + # A workflow recipient run represents an individual execution of a workflow for a + # specific recipient. + sig do + params( + id: String, + _typename: String, + inserted_at: Time, + recipient: + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ), + status: Knockapi::WorkflowRecipientRun::Status::OrSymbol, + trigger_source: Knockapi::WorkflowRecipientRun::TriggerSource::OrHash, + updated_at: Time, + workflow: String, + workflow_run_id: String, + actor: + T.nilable(T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash)), + error_count: Integer, + tenant: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the workflow recipient run (per-recipient). + id:, + # The typename of the schema. + _typename:, + # Timestamp when the resource was created. + inserted_at:, + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). + recipient:, + # The current status of the workflow recipient run. One of `queued`, `processing`, + # `paused`, `completed`, or `cancelled`. + status:, + # Describes how the workflow was triggered. + trigger_source:, + # The timestamp when the resource was last updated. + updated_at:, + # The key of the workflow that was executed. + workflow:, + # The identifier for the top-level workflow run shared across all recipients in a + # single trigger. + workflow_run_id:, + # A recipient of a notification, which is either a user or an object. + actor: nil, + # The number of errors encountered during the workflow recipient run. + error_count: nil, + # The tenant associated with the workflow recipient run. + tenant: nil + ) + end + + sig do + override.returns( + { + id: String, + _typename: String, + inserted_at: Time, + recipient: Knockapi::RecipientReference::Variants, + status: Knockapi::WorkflowRecipientRun::Status::TaggedSymbol, + trigger_source: Knockapi::WorkflowRecipientRun::TriggerSource, + updated_at: Time, + workflow: String, + workflow_run_id: String, + actor: T.nilable(Knockapi::Recipient::Variants), + error_count: Integer, + tenant: T.nilable(String) + } + ) + end + def to_hash + end + + # The current status of the workflow recipient run. One of `queued`, `processing`, + # `paused`, `completed`, or `cancelled`. + module Status + extend Knockapi::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Knockapi::WorkflowRecipientRun::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + QUEUED = + T.let(:queued, Knockapi::WorkflowRecipientRun::Status::TaggedSymbol) + PROCESSING = + T.let( + :processing, + Knockapi::WorkflowRecipientRun::Status::TaggedSymbol + ) + PAUSED = + T.let(:paused, Knockapi::WorkflowRecipientRun::Status::TaggedSymbol) + COMPLETED = + T.let( + :completed, + Knockapi::WorkflowRecipientRun::Status::TaggedSymbol + ) + CANCELLED = + T.let( + :cancelled, + Knockapi::WorkflowRecipientRun::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Knockapi::WorkflowRecipientRun::Status::TaggedSymbol] + ) + end + def self.values + end + end + + class TriggerSource < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::WorkflowRecipientRun::TriggerSource, + Knockapi::Internal::AnyHash + ) + end + + # The type of trigger source. One of `api`, `audience`, `schedule`, `broadcast`, + # `workflow_step`, `integration`, or `rehearsal`. + sig do + returns( + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The key of the audience that triggered the workflow. + sig { returns(T.nilable(String)) } + attr_accessor :audience_key + + # The cancellation key provided when the workflow was triggered via the API. + sig { returns(T.nilable(String)) } + attr_accessor :cancellation_key + + # The ID of the schedule that triggered the workflow. + sig { returns(T.nilable(String)) } + attr_accessor :schedule_id + + # Describes how the workflow was triggered. + sig do + params( + type: Knockapi::WorkflowRecipientRun::TriggerSource::Type::OrSymbol, + audience_key: T.nilable(String), + cancellation_key: T.nilable(String), + schedule_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The type of trigger source. One of `api`, `audience`, `schedule`, `broadcast`, + # `workflow_step`, `integration`, or `rehearsal`. + type:, + # The key of the audience that triggered the workflow. + audience_key: nil, + # The cancellation key provided when the workflow was triggered via the API. + cancellation_key: nil, + # The ID of the schedule that triggered the workflow. + schedule_id: nil + ) + end + + sig do + override.returns( + { + type: + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol, + audience_key: T.nilable(String), + cancellation_key: T.nilable(String), + schedule_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of trigger source. One of `api`, `audience`, `schedule`, `broadcast`, + # `workflow_step`, `integration`, or `rehearsal`. + module Type + extend Knockapi::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::WorkflowRecipientRun::TriggerSource::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + API = + T.let( + :api, + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ) + AUDIENCE = + T.let( + :audience, + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ) + SCHEDULE = + T.let( + :schedule, + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ) + BROADCAST = + T.let( + :broadcast, + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ) + WORKFLOW_STEP = + T.let( + :workflow_step, + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ) + INTEGRATION = + T.let( + :integration, + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ) + REHEARSAL = + T.let( + :rehearsal, + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Knockapi::WorkflowRecipientRun::TriggerSource::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/knockapi/models/workflow_recipient_run_detail.rbi b/rbi/knockapi/models/workflow_recipient_run_detail.rbi new file mode 100644 index 00000000..ecb2a79d --- /dev/null +++ b/rbi/knockapi/models/workflow_recipient_run_detail.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Knockapi + module Models + class WorkflowRecipientRunDetail < Knockapi::Models::WorkflowRecipientRun + OrHash = + T.type_alias do + T.any( + Knockapi::WorkflowRecipientRunDetail, + Knockapi::Internal::AnyHash + ) + end + + # A list of events that occurred during the workflow recipient run. + sig { returns(T::Array[Knockapi::WorkflowRecipientRunEvent]) } + attr_accessor :events + + # A single workflow recipient run with its events. + sig do + params( + events: T::Array[Knockapi::WorkflowRecipientRunEvent::OrHash] + ).returns(T.attached_class) + end + def self.new( + # A list of events that occurred during the workflow recipient run. + events: + ) + end + + sig do + override.returns( + { events: T::Array[Knockapi::WorkflowRecipientRunEvent] } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/knockapi/models/workflow_recipient_run_event.rbi b/rbi/knockapi/models/workflow_recipient_run_event.rbi new file mode 100644 index 00000000..2ebf781c --- /dev/null +++ b/rbi/knockapi/models/workflow_recipient_run_event.rbi @@ -0,0 +1,137 @@ +# typed: strong + +module Knockapi + module Models + class WorkflowRecipientRunEvent < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::WorkflowRecipientRunEvent, + Knockapi::Internal::AnyHash + ) + end + + # The unique identifier for the event. + sig { returns(String) } + attr_accessor :id + + # The typename of the schema. + sig { returns(String) } + attr_accessor :_typename + + # The type of event that occurred. + sig { returns(String) } + attr_accessor :event + + # Timestamp when the resource was created. + sig { returns(Time) } + attr_accessor :inserted_at + + # Whether the event represents a successful or error state. + sig { returns(Knockapi::WorkflowRecipientRunEvent::Status::TaggedSymbol) } + attr_accessor :status + + # The attempt number of the workflow recipient run event. Increments for each + # retry. + sig { returns(T.nilable(Integer)) } + attr_reader :attempt + + sig { params(attempt: Integer).void } + attr_writer :attempt + + # Event-specific data associated with the event. + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_accessor :data + + # The reference of the workflow step associated with this event. + sig { returns(T.nilable(String)) } + attr_accessor :step_ref + + # The type of workflow step associated with this event. + sig { returns(T.nilable(String)) } + attr_accessor :step_type + + # An event that occurred during a workflow recipient run. + sig do + params( + id: String, + _typename: String, + event: String, + inserted_at: Time, + status: Knockapi::WorkflowRecipientRunEvent::Status::OrSymbol, + attempt: Integer, + data: T.nilable(T::Hash[Symbol, T.anything]), + step_ref: T.nilable(String), + step_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the event. + id:, + # The typename of the schema. + _typename:, + # The type of event that occurred. + event:, + # Timestamp when the resource was created. + inserted_at:, + # Whether the event represents a successful or error state. + status:, + # The attempt number of the workflow recipient run event. Increments for each + # retry. + attempt: nil, + # Event-specific data associated with the event. + data: nil, + # The reference of the workflow step associated with this event. + step_ref: nil, + # The type of workflow step associated with this event. + step_type: nil + ) + end + + sig do + override.returns( + { + id: String, + _typename: String, + event: String, + inserted_at: Time, + status: Knockapi::WorkflowRecipientRunEvent::Status::TaggedSymbol, + attempt: Integer, + data: T.nilable(T::Hash[Symbol, T.anything]), + step_ref: T.nilable(String), + step_type: T.nilable(String) + } + ) + end + def to_hash + end + + # Whether the event represents a successful or error state. + module Status + extend Knockapi::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::WorkflowRecipientRunEvent::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OK = + T.let(:ok, Knockapi::WorkflowRecipientRunEvent::Status::TaggedSymbol) + ERROR = + T.let( + :error, + Knockapi::WorkflowRecipientRunEvent::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Knockapi::WorkflowRecipientRunEvent::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/knockapi/models/workflow_recipient_run_get_params.rbi b/rbi/knockapi/models/workflow_recipient_run_get_params.rbi new file mode 100644 index 00000000..20cc9785 --- /dev/null +++ b/rbi/knockapi/models/workflow_recipient_run_get_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Knockapi + module Models + class WorkflowRecipientRunGetParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Knockapi::WorkflowRecipientRunGetParams, + Knockapi::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: Knockapi::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/knockapi/models/workflow_recipient_run_list_params.rbi b/rbi/knockapi/models/workflow_recipient_run_list_params.rbi new file mode 100644 index 00000000..f4520da4 --- /dev/null +++ b/rbi/knockapi/models/workflow_recipient_run_list_params.rbi @@ -0,0 +1,229 @@ +# typed: strong + +module Knockapi + module Models + class WorkflowRecipientRunListParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Knockapi::WorkflowRecipientRunListParams, + Knockapi::Internal::AnyHash + ) + end + + # The cursor to fetch entries after. + sig { returns(T.nilable(String)) } + attr_reader :after + + sig { params(after: String).void } + attr_writer :after + + # The cursor to fetch entries before. + sig { returns(T.nilable(String)) } + attr_reader :before + + sig { params(before: String).void } + attr_writer :before + + # Limits the results to workflow recipient runs started before the given date. + sig { returns(T.nilable(Time)) } + attr_reader :ending_at + + sig { params(ending_at: Time).void } + attr_writer :ending_at + + # Limits the results to workflow recipient runs that have errors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_errors + + sig { params(has_errors: T::Boolean).void } + attr_writer :has_errors + + # The number of items per page (defaults to 50). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Limits the results to workflow recipient runs for the given recipient. Accepts a + # user ID string or an object reference with `id` and `collection`. + sig do + returns( + T.nilable( + T.any(String, Knockapi::RecipientReference::ObjectReference) + ) + ) + end + attr_reader :recipient + + sig do + params( + recipient: + T.any(String, Knockapi::RecipientReference::ObjectReference::OrHash) + ).void + end + attr_writer :recipient + + # Limits the results to workflow recipient runs started after the given date. + sig { returns(T.nilable(Time)) } + attr_reader :starting_at + + sig { params(starting_at: Time).void } + attr_writer :starting_at + + # Limits the results to workflow recipient runs with the given status. + sig do + returns( + T.nilable( + T::Array[Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol] + ) + ) + end + attr_reader :status + + sig do + params( + status: + T::Array[Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol] + ).void + end + attr_writer :status + + # Limits the results to workflow recipient runs for the given tenant. + sig { returns(T.nilable(String)) } + attr_reader :tenant + + sig { params(tenant: String).void } + attr_writer :tenant + + # Limits the results to workflow recipient runs for the given workflow key. + sig { returns(T.nilable(String)) } + attr_reader :workflow + + sig { params(workflow: String).void } + attr_writer :workflow + + sig do + params( + after: String, + before: String, + ending_at: Time, + has_errors: T::Boolean, + page_size: Integer, + recipient: + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ), + starting_at: Time, + status: + T::Array[ + Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol + ], + tenant: String, + workflow: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The cursor to fetch entries after. + after: nil, + # The cursor to fetch entries before. + before: nil, + # Limits the results to workflow recipient runs started before the given date. + ending_at: nil, + # Limits the results to workflow recipient runs that have errors. + has_errors: nil, + # The number of items per page (defaults to 50). + page_size: nil, + # Limits the results to workflow recipient runs for the given recipient. Accepts a + # user ID string or an object reference with `id` and `collection`. + recipient: nil, + # Limits the results to workflow recipient runs started after the given date. + starting_at: nil, + # Limits the results to workflow recipient runs with the given status. + status: nil, + # Limits the results to workflow recipient runs for the given tenant. + tenant: nil, + # Limits the results to workflow recipient runs for the given workflow key. + workflow: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + after: String, + before: String, + ending_at: Time, + has_errors: T::Boolean, + page_size: Integer, + recipient: + T.any(String, Knockapi::RecipientReference::ObjectReference), + starting_at: Time, + status: + T::Array[ + Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol + ], + tenant: String, + workflow: String, + request_options: Knockapi::RequestOptions + } + ) + end + def to_hash + end + + module Status + extend Knockapi::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Knockapi::WorkflowRecipientRunListParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + QUEUED = + T.let( + :queued, + Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol + ) + PROCESSING = + T.let( + :processing, + Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol + ) + PAUSED = + T.let( + :paused, + Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol + ) + CANCELLED = + T.let( + :cancelled, + Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Knockapi::WorkflowRecipientRunListParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/knockapi/resources/workflow_recipient_runs.rbi b/rbi/knockapi/resources/workflow_recipient_runs.rbi new file mode 100644 index 00000000..e3797e01 --- /dev/null +++ b/rbi/knockapi/resources/workflow_recipient_runs.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module Knockapi + module Resources + # A workflow run represents an individual execution of a workflow for a specific + # recipient. + class WorkflowRecipientRuns + # Returns a paginated list of workflow recipient runs for the current environment. + sig do + params( + after: String, + before: String, + ending_at: Time, + has_errors: T::Boolean, + page_size: Integer, + recipient: + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ), + starting_at: Time, + status: + T::Array[ + Knockapi::WorkflowRecipientRunListParams::Status::OrSymbol + ], + tenant: String, + workflow: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns( + Knockapi::Internal::ItemsCursor[Knockapi::WorkflowRecipientRun] + ) + end + def list( + # The cursor to fetch entries after. + after: nil, + # The cursor to fetch entries before. + before: nil, + # Limits the results to workflow recipient runs started before the given date. + ending_at: nil, + # Limits the results to workflow recipient runs that have errors. + has_errors: nil, + # The number of items per page (defaults to 50). + page_size: nil, + # Limits the results to workflow recipient runs for the given recipient. Accepts a + # user ID string or an object reference with `id` and `collection`. + recipient: nil, + # Limits the results to workflow recipient runs started after the given date. + starting_at: nil, + # Limits the results to workflow recipient runs with the given status. + status: nil, + # Limits the results to workflow recipient runs for the given tenant. + tenant: nil, + # Limits the results to workflow recipient runs for the given workflow key. + workflow: nil, + request_options: {} + ) + end + + # Returns a single workflow recipient run with its associated events. + sig do + params( + id: String, + request_options: Knockapi::RequestOptions::OrHash + ).returns(Knockapi::WorkflowRecipientRunDetail) + end + def get( + # The unique identifier for the workflow recipient run (per-recipient). + id, + request_options: {} + ) + end + + # @api private + sig { params(client: Knockapi::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/sig/knockapi/client.rbs b/sig/knockapi/client.rbs index 3b519553..c4731bb3 100644 --- a/sig/knockapi/client.rbs +++ b/sig/knockapi/client.rbs @@ -30,6 +30,8 @@ module Knockapi attr_reader workflows: Knockapi::Resources::Workflows + attr_reader workflow_recipient_runs: Knockapi::Resources::WorkflowRecipientRuns + attr_reader schedules: Knockapi::Resources::Schedules attr_reader channels: Knockapi::Resources::Channels diff --git a/sig/knockapi/models.rbs b/sig/knockapi/models.rbs index 725e951a..84bb1e4f 100644 --- a/sig/knockapi/models.rbs +++ b/sig/knockapi/models.rbs @@ -173,5 +173,15 @@ module Knockapi class WorkflowCancelParams = Knockapi::Models::WorkflowCancelParams + class WorkflowRecipientRun = Knockapi::Models::WorkflowRecipientRun + + class WorkflowRecipientRunDetail = Knockapi::Models::WorkflowRecipientRunDetail + + class WorkflowRecipientRunEvent = Knockapi::Models::WorkflowRecipientRunEvent + + class WorkflowRecipientRunGetParams = Knockapi::Models::WorkflowRecipientRunGetParams + + class WorkflowRecipientRunListParams = Knockapi::Models::WorkflowRecipientRunListParams + class WorkflowTriggerParams = Knockapi::Models::WorkflowTriggerParams end diff --git a/sig/knockapi/models/workflow_recipient_run.rbs b/sig/knockapi/models/workflow_recipient_run.rbs new file mode 100644 index 00000000..ffb0e0b2 --- /dev/null +++ b/sig/knockapi/models/workflow_recipient_run.rbs @@ -0,0 +1,146 @@ +module Knockapi + module Models + type workflow_recipient_run = + { + id: String, + _typename: String, + inserted_at: Time, + recipient: Knockapi::Models::recipient_reference, + status: Knockapi::Models::WorkflowRecipientRun::status, + trigger_source: Knockapi::WorkflowRecipientRun::TriggerSource, + updated_at: Time, + workflow: String, + workflow_run_id: String, + actor: Knockapi::Models::recipient?, + error_count: Integer, + tenant: String? + } + + class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor _typename: String + + attr_accessor inserted_at: Time + + attr_accessor recipient: Knockapi::Models::recipient_reference + + attr_accessor status: Knockapi::Models::WorkflowRecipientRun::status + + attr_accessor trigger_source: Knockapi::WorkflowRecipientRun::TriggerSource + + attr_accessor updated_at: Time + + attr_accessor workflow: String + + attr_accessor workflow_run_id: String + + attr_accessor actor: Knockapi::Models::recipient? + + attr_reader error_count: Integer? + + def error_count=: (Integer) -> Integer + + attr_accessor tenant: String? + + def initialize: ( + id: String, + _typename: String, + inserted_at: Time, + recipient: Knockapi::Models::recipient_reference, + status: Knockapi::Models::WorkflowRecipientRun::status, + trigger_source: Knockapi::WorkflowRecipientRun::TriggerSource, + updated_at: Time, + workflow: String, + workflow_run_id: String, + ?actor: Knockapi::Models::recipient?, + ?error_count: Integer, + ?tenant: String? + ) -> void + + def to_hash: -> { + id: String, + _typename: String, + inserted_at: Time, + recipient: Knockapi::Models::recipient_reference, + status: Knockapi::Models::WorkflowRecipientRun::status, + trigger_source: Knockapi::WorkflowRecipientRun::TriggerSource, + updated_at: Time, + workflow: String, + workflow_run_id: String, + actor: Knockapi::Models::recipient?, + error_count: Integer, + tenant: String? + } + + type status = :queued | :processing | :paused | :completed | :cancelled + + module Status + extend Knockapi::Internal::Type::Enum + + QUEUED: :queued + PROCESSING: :processing + PAUSED: :paused + COMPLETED: :completed + CANCELLED: :cancelled + + def self?.values: -> ::Array[Knockapi::Models::WorkflowRecipientRun::status] + end + + type trigger_source = + { + type: Knockapi::Models::WorkflowRecipientRun::TriggerSource::type_, + audience_key: String?, + cancellation_key: String?, + schedule_id: String? + } + + class TriggerSource < Knockapi::Internal::Type::BaseModel + attr_accessor type: Knockapi::Models::WorkflowRecipientRun::TriggerSource::type_ + + attr_accessor audience_key: String? + + attr_accessor cancellation_key: String? + + attr_accessor schedule_id: String? + + def initialize: ( + type: Knockapi::Models::WorkflowRecipientRun::TriggerSource::type_, + ?audience_key: String?, + ?cancellation_key: String?, + ?schedule_id: String? + ) -> void + + def to_hash: -> { + type: Knockapi::Models::WorkflowRecipientRun::TriggerSource::type_, + audience_key: String?, + cancellation_key: String?, + schedule_id: String? + } + + type type_ = + :api + | :audience + | :schedule + | :broadcast + | :workflow_step + | :integration + | :rehearsal + + module Type + extend Knockapi::Internal::Type::Enum + + API: :api + AUDIENCE: :audience + SCHEDULE: :schedule + BROADCAST: :broadcast + WORKFLOW_STEP: :workflow_step + INTEGRATION: :integration + REHEARSAL: :rehearsal + + def self?.values: -> ::Array[Knockapi::Models::WorkflowRecipientRun::TriggerSource::type_] + end + end + end + end +end diff --git a/sig/knockapi/models/workflow_recipient_run_detail.rbs b/sig/knockapi/models/workflow_recipient_run_detail.rbs new file mode 100644 index 00000000..277332bc --- /dev/null +++ b/sig/knockapi/models/workflow_recipient_run_detail.rbs @@ -0,0 +1,20 @@ +module Knockapi + module Models + type workflow_recipient_run_detail = + { events: ::Array[Knockapi::WorkflowRecipientRunEvent] } + + class WorkflowRecipientRunDetail < Knockapi::Models::WorkflowRecipientRun + def events: -> ::Array[Knockapi::WorkflowRecipientRunEvent] + + def events=: ( + ::Array[Knockapi::WorkflowRecipientRunEvent] _ + ) -> ::Array[Knockapi::WorkflowRecipientRunEvent] + + def initialize: ( + events: ::Array[Knockapi::WorkflowRecipientRunEvent] + ) -> void + + def to_hash: -> { events: ::Array[Knockapi::WorkflowRecipientRunEvent] } + end + end +end diff --git a/sig/knockapi/models/workflow_recipient_run_event.rbs b/sig/knockapi/models/workflow_recipient_run_event.rbs new file mode 100644 index 00000000..f55ca13f --- /dev/null +++ b/sig/knockapi/models/workflow_recipient_run_event.rbs @@ -0,0 +1,73 @@ +module Knockapi + module Models + type workflow_recipient_run_event = + { + id: String, + _typename: String, + event: String, + inserted_at: Time, + status: Knockapi::Models::WorkflowRecipientRunEvent::status, + attempt: Integer, + data: ::Hash[Symbol, top]?, + step_ref: String?, + step_type: String? + } + + class WorkflowRecipientRunEvent < Knockapi::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor _typename: String + + attr_accessor event: String + + attr_accessor inserted_at: Time + + attr_accessor status: Knockapi::Models::WorkflowRecipientRunEvent::status + + attr_reader attempt: Integer? + + def attempt=: (Integer) -> Integer + + attr_accessor data: ::Hash[Symbol, top]? + + attr_accessor step_ref: String? + + attr_accessor step_type: String? + + def initialize: ( + id: String, + _typename: String, + event: String, + inserted_at: Time, + status: Knockapi::Models::WorkflowRecipientRunEvent::status, + ?attempt: Integer, + ?data: ::Hash[Symbol, top]?, + ?step_ref: String?, + ?step_type: String? + ) -> void + + def to_hash: -> { + id: String, + _typename: String, + event: String, + inserted_at: Time, + status: Knockapi::Models::WorkflowRecipientRunEvent::status, + attempt: Integer, + data: ::Hash[Symbol, top]?, + step_ref: String?, + step_type: String? + } + + type status = :ok | :error + + module Status + extend Knockapi::Internal::Type::Enum + + OK: :ok + ERROR: :error + + def self?.values: -> ::Array[Knockapi::Models::WorkflowRecipientRunEvent::status] + end + end + end +end diff --git a/sig/knockapi/models/workflow_recipient_run_get_params.rbs b/sig/knockapi/models/workflow_recipient_run_get_params.rbs new file mode 100644 index 00000000..268bc549 --- /dev/null +++ b/sig/knockapi/models/workflow_recipient_run_get_params.rbs @@ -0,0 +1,20 @@ +module Knockapi + module Models + type workflow_recipient_run_get_params = + { id: String } & Knockapi::Internal::Type::request_parameters + + class WorkflowRecipientRunGetParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: Knockapi::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: Knockapi::RequestOptions } + end + end +end diff --git a/sig/knockapi/models/workflow_recipient_run_list_params.rbs b/sig/knockapi/models/workflow_recipient_run_list_params.rbs new file mode 100644 index 00000000..bae2ea07 --- /dev/null +++ b/sig/knockapi/models/workflow_recipient_run_list_params.rbs @@ -0,0 +1,109 @@ +module Knockapi + module Models + type workflow_recipient_run_list_params = + { + after: String, + before: String, + ending_at: Time, + has_errors: bool, + page_size: Integer, + recipient: Knockapi::Models::recipient_reference, + starting_at: Time, + status: ::Array[Knockapi::Models::WorkflowRecipientRunListParams::status], + tenant: String, + workflow: String + } + & Knockapi::Internal::Type::request_parameters + + class WorkflowRecipientRunListParams < Knockapi::Internal::Type::BaseModel + extend Knockapi::Internal::Type::RequestParameters::Converter + include Knockapi::Internal::Type::RequestParameters + + attr_reader after: String? + + def after=: (String) -> String + + attr_reader before: String? + + def before=: (String) -> String + + attr_reader ending_at: Time? + + def ending_at=: (Time) -> Time + + attr_reader has_errors: bool? + + def has_errors=: (bool) -> bool + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader recipient: Knockapi::Models::recipient_reference? + + def recipient=: ( + Knockapi::Models::recipient_reference + ) -> Knockapi::Models::recipient_reference + + attr_reader starting_at: Time? + + def starting_at=: (Time) -> Time + + attr_reader status: ::Array[Knockapi::Models::WorkflowRecipientRunListParams::status]? + + def status=: ( + ::Array[Knockapi::Models::WorkflowRecipientRunListParams::status] + ) -> ::Array[Knockapi::Models::WorkflowRecipientRunListParams::status] + + attr_reader tenant: String? + + def tenant=: (String) -> String + + attr_reader workflow: String? + + def workflow=: (String) -> String + + def initialize: ( + ?after: String, + ?before: String, + ?ending_at: Time, + ?has_errors: bool, + ?page_size: Integer, + ?recipient: Knockapi::Models::recipient_reference, + ?starting_at: Time, + ?status: ::Array[Knockapi::Models::WorkflowRecipientRunListParams::status], + ?tenant: String, + ?workflow: String, + ?request_options: Knockapi::request_opts + ) -> void + + def to_hash: -> { + after: String, + before: String, + ending_at: Time, + has_errors: bool, + page_size: Integer, + recipient: Knockapi::Models::recipient_reference, + starting_at: Time, + status: ::Array[Knockapi::Models::WorkflowRecipientRunListParams::status], + tenant: String, + workflow: String, + request_options: Knockapi::RequestOptions + } + + type status = :queued | :processing | :paused | :completed | :cancelled + + module Status + extend Knockapi::Internal::Type::Enum + + QUEUED: :queued + PROCESSING: :processing + PAUSED: :paused + COMPLETED: :completed + CANCELLED: :cancelled + + def self?.values: -> ::Array[Knockapi::Models::WorkflowRecipientRunListParams::status] + end + end + end +end diff --git a/sig/knockapi/resources/workflow_recipient_runs.rbs b/sig/knockapi/resources/workflow_recipient_runs.rbs new file mode 100644 index 00000000..1da6e025 --- /dev/null +++ b/sig/knockapi/resources/workflow_recipient_runs.rbs @@ -0,0 +1,26 @@ +module Knockapi + module Resources + class WorkflowRecipientRuns + def list: ( + ?after: String, + ?before: String, + ?ending_at: Time, + ?has_errors: bool, + ?page_size: Integer, + ?recipient: Knockapi::Models::recipient_reference, + ?starting_at: Time, + ?status: ::Array[Knockapi::Models::WorkflowRecipientRunListParams::status], + ?tenant: String, + ?workflow: String, + ?request_options: Knockapi::request_opts + ) -> Knockapi::Internal::ItemsCursor[Knockapi::WorkflowRecipientRun] + + def get: ( + String id, + ?request_options: Knockapi::request_opts + ) -> Knockapi::WorkflowRecipientRunDetail + + def initialize: (client: Knockapi::Client) -> void + end + end +end diff --git a/test/knockapi/resources/workflow_recipient_runs_test.rb b/test/knockapi/resources/workflow_recipient_runs_test.rb new file mode 100644 index 00000000..149236c6 --- /dev/null +++ b/test/knockapi/resources/workflow_recipient_runs_test.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Knockapi::Test::Resources::WorkflowRecipientRunsTest < Knockapi::Test::ResourceTest + def test_list + response = @knock.workflow_recipient_runs.list + + assert_pattern do + response => Knockapi::Internal::ItemsCursor + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Knockapi::WorkflowRecipientRun + end + + assert_pattern do + row => { + id: String, + _typename: String, + inserted_at: Time, + recipient: Knockapi::RecipientReference, + status: Knockapi::WorkflowRecipientRun::Status, + trigger_source: Knockapi::WorkflowRecipientRun::TriggerSource, + updated_at: Time, + workflow: String, + workflow_run_id: String, + actor: Knockapi::Recipient | nil, + error_count: Integer | nil, + tenant: String | nil + } + end + end + + def test_get + response = @knock.workflow_recipient_runs.get("id") + + assert_pattern do + response => Knockapi::WorkflowRecipientRunDetail + end + end +end From 1023475aa6b6f5c04dae72aaf7ad397aa769e033 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 14:01:43 +0000 Subject: [PATCH 15/41] chore(internal): more robust bootstrap script --- scripts/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index 34878642..a5e1b80a 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd -- "$(dirname -- "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response From 628d4cc040ba05590a453be6824ea9329792f394 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 19:07:26 +0000 Subject: [PATCH 16/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/workflow_recipient_run.rb | 9 +++++---- rbi/knockapi/models/workflow_recipient_run.rbi | 17 ++++++++++++----- sig/knockapi/models/workflow_recipient_run.rbs | 8 ++++---- .../resources/workflow_recipient_runs_test.rb | 2 +- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0299b17b..1fbd43d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-3e8f3a4664d48b3d546339018b451a356f8e20c223a2d21e7c3824fad4cddc7b.yml -openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-4b8499dddbc5ac767491c492be1629f4f10a17442cf84e13e10fe38b7dcb713c.yml +openapi_spec_hash: 98edfca809c07521259de151d3fc5684 config_hash: 2008af3064bfaa2ba7828708de5d97a8 diff --git a/lib/knockapi/models/workflow_recipient_run.rb b/lib/knockapi/models/workflow_recipient_run.rb index b2c72feb..ea92ae82 100644 --- a/lib/knockapi/models/workflow_recipient_run.rb +++ b/lib/knockapi/models/workflow_recipient_run.rb @@ -62,10 +62,11 @@ class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel required :workflow_run_id, String # @!attribute actor - # A recipient of a notification, which is either a user or an object. + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). # - # @return [Knockapi::Models::User, Knockapi::Models::Object, nil] - optional :actor, union: -> { Knockapi::Recipient }, nil?: true + # @return [String, Knockapi::Models::RecipientReference::ObjectReference, nil] + optional :actor, union: -> { Knockapi::RecipientReference }, nil?: true # @!attribute error_count # The number of errors encountered during the workflow recipient run. @@ -104,7 +105,7 @@ class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel # # @param workflow_run_id [String] The identifier for the top-level workflow run shared across all recipients in a # - # @param actor [Knockapi::Models::User, Knockapi::Models::Object, nil] A recipient of a notification, which is either a user or an object. + # @param actor [String, Knockapi::Models::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer # # @param error_count [Integer] The number of errors encountered during the workflow recipient run. # diff --git a/rbi/knockapi/models/workflow_recipient_run.rbi b/rbi/knockapi/models/workflow_recipient_run.rbi index 3cea8be6..27e1586a 100644 --- a/rbi/knockapi/models/workflow_recipient_run.rbi +++ b/rbi/knockapi/models/workflow_recipient_run.rbi @@ -54,8 +54,9 @@ module Knockapi sig { returns(String) } attr_accessor :workflow_run_id - # A recipient of a notification, which is either a user or an object. - sig { returns(T.nilable(Knockapi::Recipient::Variants)) } + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). + sig { returns(T.nilable(Knockapi::RecipientReference::Variants)) } attr_accessor :actor # The number of errors encountered during the workflow recipient run. @@ -87,7 +88,12 @@ module Knockapi workflow: String, workflow_run_id: String, actor: - T.nilable(T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash)), + T.nilable( + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ), error_count: Integer, tenant: T.nilable(String) ).returns(T.attached_class) @@ -114,7 +120,8 @@ module Knockapi # The identifier for the top-level workflow run shared across all recipients in a # single trigger. workflow_run_id:, - # A recipient of a notification, which is either a user or an object. + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). actor: nil, # The number of errors encountered during the workflow recipient run. error_count: nil, @@ -135,7 +142,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: T.nilable(Knockapi::Recipient::Variants), + actor: T.nilable(Knockapi::RecipientReference::Variants), error_count: Integer, tenant: T.nilable(String) } diff --git a/sig/knockapi/models/workflow_recipient_run.rbs b/sig/knockapi/models/workflow_recipient_run.rbs index ffb0e0b2..48a7eb86 100644 --- a/sig/knockapi/models/workflow_recipient_run.rbs +++ b/sig/knockapi/models/workflow_recipient_run.rbs @@ -11,7 +11,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::Models::recipient?, + actor: Knockapi::Models::recipient_reference?, error_count: Integer, tenant: String? } @@ -35,7 +35,7 @@ module Knockapi attr_accessor workflow_run_id: String - attr_accessor actor: Knockapi::Models::recipient? + attr_accessor actor: Knockapi::Models::recipient_reference? attr_reader error_count: Integer? @@ -53,7 +53,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - ?actor: Knockapi::Models::recipient?, + ?actor: Knockapi::Models::recipient_reference?, ?error_count: Integer, ?tenant: String? ) -> void @@ -68,7 +68,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::Models::recipient?, + actor: Knockapi::Models::recipient_reference?, error_count: Integer, tenant: String? } diff --git a/test/knockapi/resources/workflow_recipient_runs_test.rb b/test/knockapi/resources/workflow_recipient_runs_test.rb index 149236c6..5222d5e8 100644 --- a/test/knockapi/resources/workflow_recipient_runs_test.rb +++ b/test/knockapi/resources/workflow_recipient_runs_test.rb @@ -28,7 +28,7 @@ def test_list updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::Recipient | nil, + actor: Knockapi::RecipientReference | nil, error_count: Integer | nil, tenant: String | nil } From da22d6e5573c3f093d081edcb6881ac23fcf9173 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 13:25:12 +0000 Subject: [PATCH 17/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/workflow_recipient_run.rb | 9 ++++----- rbi/knockapi/models/workflow_recipient_run.rbi | 17 +++++------------ sig/knockapi/models/workflow_recipient_run.rbs | 8 ++++---- .../resources/workflow_recipient_runs_test.rb | 2 +- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1fbd43d5..0299b17b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-4b8499dddbc5ac767491c492be1629f4f10a17442cf84e13e10fe38b7dcb713c.yml -openapi_spec_hash: 98edfca809c07521259de151d3fc5684 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-3e8f3a4664d48b3d546339018b451a356f8e20c223a2d21e7c3824fad4cddc7b.yml +openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 config_hash: 2008af3064bfaa2ba7828708de5d97a8 diff --git a/lib/knockapi/models/workflow_recipient_run.rb b/lib/knockapi/models/workflow_recipient_run.rb index ea92ae82..b2c72feb 100644 --- a/lib/knockapi/models/workflow_recipient_run.rb +++ b/lib/knockapi/models/workflow_recipient_run.rb @@ -62,11 +62,10 @@ class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel required :workflow_run_id, String # @!attribute actor - # A reference to a recipient, either a user identifier (string) or an object - # reference (ID, collection). + # A recipient of a notification, which is either a user or an object. # - # @return [String, Knockapi::Models::RecipientReference::ObjectReference, nil] - optional :actor, union: -> { Knockapi::RecipientReference }, nil?: true + # @return [Knockapi::Models::User, Knockapi::Models::Object, nil] + optional :actor, union: -> { Knockapi::Recipient }, nil?: true # @!attribute error_count # The number of errors encountered during the workflow recipient run. @@ -105,7 +104,7 @@ class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel # # @param workflow_run_id [String] The identifier for the top-level workflow run shared across all recipients in a # - # @param actor [String, Knockapi::Models::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer + # @param actor [Knockapi::Models::User, Knockapi::Models::Object, nil] A recipient of a notification, which is either a user or an object. # # @param error_count [Integer] The number of errors encountered during the workflow recipient run. # diff --git a/rbi/knockapi/models/workflow_recipient_run.rbi b/rbi/knockapi/models/workflow_recipient_run.rbi index 27e1586a..3cea8be6 100644 --- a/rbi/knockapi/models/workflow_recipient_run.rbi +++ b/rbi/knockapi/models/workflow_recipient_run.rbi @@ -54,9 +54,8 @@ module Knockapi sig { returns(String) } attr_accessor :workflow_run_id - # A reference to a recipient, either a user identifier (string) or an object - # reference (ID, collection). - sig { returns(T.nilable(Knockapi::RecipientReference::Variants)) } + # A recipient of a notification, which is either a user or an object. + sig { returns(T.nilable(Knockapi::Recipient::Variants)) } attr_accessor :actor # The number of errors encountered during the workflow recipient run. @@ -88,12 +87,7 @@ module Knockapi workflow: String, workflow_run_id: String, actor: - T.nilable( - T.any( - String, - Knockapi::RecipientReference::ObjectReference::OrHash - ) - ), + T.nilable(T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash)), error_count: Integer, tenant: T.nilable(String) ).returns(T.attached_class) @@ -120,8 +114,7 @@ module Knockapi # The identifier for the top-level workflow run shared across all recipients in a # single trigger. workflow_run_id:, - # A reference to a recipient, either a user identifier (string) or an object - # reference (ID, collection). + # A recipient of a notification, which is either a user or an object. actor: nil, # The number of errors encountered during the workflow recipient run. error_count: nil, @@ -142,7 +135,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: T.nilable(Knockapi::RecipientReference::Variants), + actor: T.nilable(Knockapi::Recipient::Variants), error_count: Integer, tenant: T.nilable(String) } diff --git a/sig/knockapi/models/workflow_recipient_run.rbs b/sig/knockapi/models/workflow_recipient_run.rbs index 48a7eb86..ffb0e0b2 100644 --- a/sig/knockapi/models/workflow_recipient_run.rbs +++ b/sig/knockapi/models/workflow_recipient_run.rbs @@ -11,7 +11,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::Models::recipient_reference?, + actor: Knockapi::Models::recipient?, error_count: Integer, tenant: String? } @@ -35,7 +35,7 @@ module Knockapi attr_accessor workflow_run_id: String - attr_accessor actor: Knockapi::Models::recipient_reference? + attr_accessor actor: Knockapi::Models::recipient? attr_reader error_count: Integer? @@ -53,7 +53,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - ?actor: Knockapi::Models::recipient_reference?, + ?actor: Knockapi::Models::recipient?, ?error_count: Integer, ?tenant: String? ) -> void @@ -68,7 +68,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::Models::recipient_reference?, + actor: Knockapi::Models::recipient?, error_count: Integer, tenant: String? } diff --git a/test/knockapi/resources/workflow_recipient_runs_test.rb b/test/knockapi/resources/workflow_recipient_runs_test.rb index 5222d5e8..149236c6 100644 --- a/test/knockapi/resources/workflow_recipient_runs_test.rb +++ b/test/knockapi/resources/workflow_recipient_runs_test.rb @@ -28,7 +28,7 @@ def test_list updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::RecipientReference | nil, + actor: Knockapi::Recipient | nil, error_count: Integer | nil, tenant: String | nil } From 74dcf58784264882fb1a770935a9de1ff01685b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 14:38:45 +0000 Subject: [PATCH 18/41] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0299b17b..86d162ea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-3e8f3a4664d48b3d546339018b451a356f8e20c223a2d21e7c3824fad4cddc7b.yml openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 -config_hash: 2008af3064bfaa2ba7828708de5d97a8 +config_hash: 625db64572b7ee0ee1dd00546e53fc5f From bd578791c347de8b63caf60ba6340f19ac3a6a48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 17:20:10 +0000 Subject: [PATCH 19/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/workflow_recipient_run.rb | 9 +++++---- rbi/knockapi/models/workflow_recipient_run.rbi | 17 ++++++++++++----- sig/knockapi/models/workflow_recipient_run.rbs | 8 ++++---- .../resources/workflow_recipient_runs_test.rb | 2 +- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 86d162ea..c2b62580 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-3e8f3a4664d48b3d546339018b451a356f8e20c223a2d21e7c3824fad4cddc7b.yml -openapi_spec_hash: c2b6637451a63e39c1f1042c6a7cc7f7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-4b8499dddbc5ac767491c492be1629f4f10a17442cf84e13e10fe38b7dcb713c.yml +openapi_spec_hash: 98edfca809c07521259de151d3fc5684 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/workflow_recipient_run.rb b/lib/knockapi/models/workflow_recipient_run.rb index b2c72feb..ea92ae82 100644 --- a/lib/knockapi/models/workflow_recipient_run.rb +++ b/lib/knockapi/models/workflow_recipient_run.rb @@ -62,10 +62,11 @@ class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel required :workflow_run_id, String # @!attribute actor - # A recipient of a notification, which is either a user or an object. + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). # - # @return [Knockapi::Models::User, Knockapi::Models::Object, nil] - optional :actor, union: -> { Knockapi::Recipient }, nil?: true + # @return [String, Knockapi::Models::RecipientReference::ObjectReference, nil] + optional :actor, union: -> { Knockapi::RecipientReference }, nil?: true # @!attribute error_count # The number of errors encountered during the workflow recipient run. @@ -104,7 +105,7 @@ class WorkflowRecipientRun < Knockapi::Internal::Type::BaseModel # # @param workflow_run_id [String] The identifier for the top-level workflow run shared across all recipients in a # - # @param actor [Knockapi::Models::User, Knockapi::Models::Object, nil] A recipient of a notification, which is either a user or an object. + # @param actor [String, Knockapi::Models::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer # # @param error_count [Integer] The number of errors encountered during the workflow recipient run. # diff --git a/rbi/knockapi/models/workflow_recipient_run.rbi b/rbi/knockapi/models/workflow_recipient_run.rbi index 3cea8be6..27e1586a 100644 --- a/rbi/knockapi/models/workflow_recipient_run.rbi +++ b/rbi/knockapi/models/workflow_recipient_run.rbi @@ -54,8 +54,9 @@ module Knockapi sig { returns(String) } attr_accessor :workflow_run_id - # A recipient of a notification, which is either a user or an object. - sig { returns(T.nilable(Knockapi::Recipient::Variants)) } + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). + sig { returns(T.nilable(Knockapi::RecipientReference::Variants)) } attr_accessor :actor # The number of errors encountered during the workflow recipient run. @@ -87,7 +88,12 @@ module Knockapi workflow: String, workflow_run_id: String, actor: - T.nilable(T.any(Knockapi::User::OrHash, Knockapi::Object::OrHash)), + T.nilable( + T.any( + String, + Knockapi::RecipientReference::ObjectReference::OrHash + ) + ), error_count: Integer, tenant: T.nilable(String) ).returns(T.attached_class) @@ -114,7 +120,8 @@ module Knockapi # The identifier for the top-level workflow run shared across all recipients in a # single trigger. workflow_run_id:, - # A recipient of a notification, which is either a user or an object. + # A reference to a recipient, either a user identifier (string) or an object + # reference (ID, collection). actor: nil, # The number of errors encountered during the workflow recipient run. error_count: nil, @@ -135,7 +142,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: T.nilable(Knockapi::Recipient::Variants), + actor: T.nilable(Knockapi::RecipientReference::Variants), error_count: Integer, tenant: T.nilable(String) } diff --git a/sig/knockapi/models/workflow_recipient_run.rbs b/sig/knockapi/models/workflow_recipient_run.rbs index ffb0e0b2..48a7eb86 100644 --- a/sig/knockapi/models/workflow_recipient_run.rbs +++ b/sig/knockapi/models/workflow_recipient_run.rbs @@ -11,7 +11,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::Models::recipient?, + actor: Knockapi::Models::recipient_reference?, error_count: Integer, tenant: String? } @@ -35,7 +35,7 @@ module Knockapi attr_accessor workflow_run_id: String - attr_accessor actor: Knockapi::Models::recipient? + attr_accessor actor: Knockapi::Models::recipient_reference? attr_reader error_count: Integer? @@ -53,7 +53,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - ?actor: Knockapi::Models::recipient?, + ?actor: Knockapi::Models::recipient_reference?, ?error_count: Integer, ?tenant: String? ) -> void @@ -68,7 +68,7 @@ module Knockapi updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::Models::recipient?, + actor: Knockapi::Models::recipient_reference?, error_count: Integer, tenant: String? } diff --git a/test/knockapi/resources/workflow_recipient_runs_test.rb b/test/knockapi/resources/workflow_recipient_runs_test.rb index 149236c6..5222d5e8 100644 --- a/test/knockapi/resources/workflow_recipient_runs_test.rb +++ b/test/knockapi/resources/workflow_recipient_runs_test.rb @@ -28,7 +28,7 @@ def test_list updated_at: Time, workflow: String, workflow_run_id: String, - actor: Knockapi::Recipient | nil, + actor: Knockapi::RecipientReference | nil, error_count: Integer | nil, tenant: String | nil } From ad75b97225fd6634d7850dde00d5035e64d168a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 22:30:07 +0000 Subject: [PATCH 20/41] feat: support setting headers via env --- lib/knockapi/client.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/knockapi/client.rb b/lib/knockapi/client.rb index 7fed4331..1eaa5944 100644 --- a/lib/knockapi/client.rb +++ b/lib/knockapi/client.rb @@ -122,6 +122,17 @@ def initialize( headers = { "x-knock-branch" => (@branch = branch&.to_s) } + custom_headers_env = ENV["KNOCK_CUSTOM_HEADERS"] + unless custom_headers_env.nil? + parsed = {} + custom_headers_env.split("\n").each do |line| + colon = line.index(":") + unless colon.nil? + parsed[line[0...colon].strip] = line[(colon + 1)..].strip + end + end + headers = parsed.merge(headers) + end @api_key = api_key.to_s From 99888a27cd1da82f323ac1be0e4aabc91f32e7d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 18:16:10 +0000 Subject: [PATCH 21/41] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c2b62580..af6f4c64 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-4b8499dddbc5ac767491c492be1629f4f10a17442cf84e13e10fe38b7dcb713c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-4b8499dddbc5ac767491c492be1629f4f10a17442cf84e13e10fe38b7dcb713c.yml openapi_spec_hash: 98edfca809c07521259de151d3fc5684 config_hash: 625db64572b7ee0ee1dd00546e53fc5f From 14c7bc73e1677dc239ac48035ee0b034709750ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:36:42 +0000 Subject: [PATCH 22/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/workflow_cancel_params.rb | 12 +++++------ .../models/workflow_trigger_params.rb | 12 +++++------ lib/knockapi/resources/workflows.rb | 4 ++-- .../models/workflow_cancel_params.rbi | 20 +++++++++---------- .../models/workflow_trigger_params.rbi | 20 +++++++++---------- rbi/knockapi/resources/workflows.rbi | 20 +++++++++---------- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.stats.yml b/.stats.yml index af6f4c64..479881b4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-4b8499dddbc5ac767491c492be1629f4f10a17442cf84e13e10fe38b7dcb713c.yml -openapi_spec_hash: 98edfca809c07521259de151d3fc5684 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-0d9b2038188e6e237e90e7d04144af0b48d60f006c49172ffb5e5c0151187d3b.yml +openapi_spec_hash: a37bbcbd9f496e5469be9a756bdaa0e9 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/workflow_cancel_params.rb b/lib/knockapi/models/workflow_cancel_params.rb index e82ae474..6e0a45c9 100644 --- a/lib/knockapi/models/workflow_cancel_params.rb +++ b/lib/knockapi/models/workflow_cancel_params.rb @@ -13,11 +13,11 @@ class WorkflowCancelParams < Knockapi::Internal::Type::BaseModel required :key, String # @!attribute cancellation_key - # An optional key that is used to reference a specific workflow trigger request - # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) - # request. Must be provided while triggering a workflow in order to enable - # subsequent cancellation. Should be unique across trigger requests to avoid - # unintentional cancellations. + # A key that is used to reference a specific workflow trigger request when issuing + # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must + # be provided while triggering a workflow in order to enable subsequent + # cancellation. Should be unique across trigger requests to avoid unintentional + # cancellations. # # @return [String] required :cancellation_key, String @@ -37,7 +37,7 @@ class WorkflowCancelParams < Knockapi::Internal::Type::BaseModel # # @param key [String] # - # @param cancellation_key [String] An optional key that is used to reference a specific workflow trigger request wh + # @param cancellation_key [String] A key that is used to reference a specific workflow trigger request when issuing # # @param recipients [Array, nil] A list of recipients to cancel the notification for. If omitted, cancels for all # diff --git a/lib/knockapi/models/workflow_trigger_params.rb b/lib/knockapi/models/workflow_trigger_params.rb index 3fcbd1c7..1ea61598 100644 --- a/lib/knockapi/models/workflow_trigger_params.rb +++ b/lib/knockapi/models/workflow_trigger_params.rb @@ -28,11 +28,11 @@ class WorkflowTriggerParams < Knockapi::Internal::Type::BaseModel optional :actor, union: -> { Knockapi::RecipientRequest }, nil?: true # @!attribute cancellation_key - # An optional key that is used to reference a specific workflow trigger request - # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) - # request. Must be provided while triggering a workflow in order to enable - # subsequent cancellation. Should be unique across trigger requests to avoid - # unintentional cancellations. + # A key that is used to reference a specific workflow trigger request when issuing + # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must + # be provided while triggering a workflow in order to enable subsequent + # cancellation. Should be unique across trigger requests to avoid unintentional + # cancellations. # # @return [String, nil] optional :cancellation_key, String, nil?: true @@ -62,7 +62,7 @@ class WorkflowTriggerParams < Knockapi::Internal::Type::BaseModel # # @param actor [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string # - # @param cancellation_key [String, nil] An optional key that is used to reference a specific workflow trigger request wh + # @param cancellation_key [String, nil] A key that is used to reference a specific workflow trigger request when issuing # # @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim # diff --git a/lib/knockapi/resources/workflows.rb b/lib/knockapi/resources/workflows.rb index d5825cd4..3dfbb80e 100644 --- a/lib/knockapi/resources/workflows.rb +++ b/lib/knockapi/resources/workflows.rb @@ -16,7 +16,7 @@ class Workflows # # @param key [String] The key of the workflow to cancel. # - # @param cancellation_key [String] An optional key that is used to reference a specific workflow trigger request wh + # @param cancellation_key [String] A key that is used to reference a specific workflow trigger request when issuing # # @param recipients [Array, nil] A list of recipients to cancel the notification for. If omitted, cancels for all # @@ -53,7 +53,7 @@ def cancel(key, params) # # @param actor [String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest, nil] Specifies a recipient in a request. This can either be a user identifier (string # - # @param cancellation_key [String, nil] An optional key that is used to reference a specific workflow trigger request wh + # @param cancellation_key [String, nil] A key that is used to reference a specific workflow trigger request when issuing # # @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim # diff --git a/rbi/knockapi/models/workflow_cancel_params.rbi b/rbi/knockapi/models/workflow_cancel_params.rbi index 44c2053c..f71150ab 100644 --- a/rbi/knockapi/models/workflow_cancel_params.rbi +++ b/rbi/knockapi/models/workflow_cancel_params.rbi @@ -14,11 +14,11 @@ module Knockapi sig { returns(String) } attr_accessor :key - # An optional key that is used to reference a specific workflow trigger request - # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) - # request. Must be provided while triggering a workflow in order to enable - # subsequent cancellation. Should be unique across trigger requests to avoid - # unintentional cancellations. + # A key that is used to reference a specific workflow trigger request when issuing + # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must + # be provided while triggering a workflow in order to enable subsequent + # cancellation. Should be unique across trigger requests to avoid unintentional + # cancellations. sig { returns(String) } attr_accessor :cancellation_key @@ -53,11 +53,11 @@ module Knockapi end def self.new( key:, - # An optional key that is used to reference a specific workflow trigger request - # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) - # request. Must be provided while triggering a workflow in order to enable - # subsequent cancellation. Should be unique across trigger requests to avoid - # unintentional cancellations. + # A key that is used to reference a specific workflow trigger request when issuing + # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must + # be provided while triggering a workflow in order to enable subsequent + # cancellation. Should be unique across trigger requests to avoid unintentional + # cancellations. cancellation_key:, # A list of recipients to cancel the notification for. If omitted, cancels for all # recipients associated with the cancellation key. diff --git a/rbi/knockapi/models/workflow_trigger_params.rbi b/rbi/knockapi/models/workflow_trigger_params.rbi index cac4fc87..87ce315e 100644 --- a/rbi/knockapi/models/workflow_trigger_params.rbi +++ b/rbi/knockapi/models/workflow_trigger_params.rbi @@ -45,11 +45,11 @@ module Knockapi end attr_accessor :actor - # An optional key that is used to reference a specific workflow trigger request - # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) - # request. Must be provided while triggering a workflow in order to enable - # subsequent cancellation. Should be unique across trigger requests to avoid - # unintentional cancellations. + # A key that is used to reference a specific workflow trigger request when issuing + # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must + # be provided while triggering a workflow in order to enable subsequent + # cancellation. Should be unique across trigger requests to avoid unintentional + # cancellations. sig { returns(T.nilable(String)) } attr_accessor :cancellation_key @@ -98,11 +98,11 @@ module Knockapi # (string), an inline user request (object), or an inline object request, which is # determined by the presence of a `collection` property. actor: nil, - # An optional key that is used to reference a specific workflow trigger request - # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) - # request. Must be provided while triggering a workflow in order to enable - # subsequent cancellation. Should be unique across trigger requests to avoid - # unintentional cancellations. + # A key that is used to reference a specific workflow trigger request when issuing + # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must + # be provided while triggering a workflow in order to enable subsequent + # cancellation. Should be unique across trigger requests to avoid unintentional + # cancellations. cancellation_key: nil, # An optional map of data to pass into the workflow execution. There is a 10MB # limit on the size of the full `data` payload. Any individual string value diff --git a/rbi/knockapi/resources/workflows.rbi b/rbi/knockapi/resources/workflows.rbi index a2224aeb..53cb0784 100644 --- a/rbi/knockapi/resources/workflows.rbi +++ b/rbi/knockapi/resources/workflows.rbi @@ -27,11 +27,11 @@ module Knockapi def cancel( # The key of the workflow to cancel. key, - # An optional key that is used to reference a specific workflow trigger request - # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) - # request. Must be provided while triggering a workflow in order to enable - # subsequent cancellation. Should be unique across trigger requests to avoid - # unintentional cancellations. + # A key that is used to reference a specific workflow trigger request when issuing + # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must + # be provided while triggering a workflow in order to enable subsequent + # cancellation. Should be unique across trigger requests to avoid unintentional + # cancellations. cancellation_key:, # A list of recipients to cancel the notification for. If omitted, cancels for all # recipients associated with the cancellation key. @@ -80,11 +80,11 @@ module Knockapi # (string), an inline user request (object), or an inline object request, which is # determined by the presence of a `collection` property. actor: nil, - # An optional key that is used to reference a specific workflow trigger request - # when issuing a [workflow cancellation](/send-notifications/canceling-workflows) - # request. Must be provided while triggering a workflow in order to enable - # subsequent cancellation. Should be unique across trigger requests to avoid - # unintentional cancellations. + # A key that is used to reference a specific workflow trigger request when issuing + # a [workflow cancellation](/send-notifications/canceling-workflows) request. Must + # be provided while triggering a workflow in order to enable subsequent + # cancellation. Should be unique across trigger requests to avoid unintentional + # cancellations. cancellation_key: nil, # An optional map of data to pass into the workflow execution. There is a 10MB # limit on the size of the full `data` payload. Any individual string value From 99d03c121555060b966f3c40a2184016cd561391 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:23:33 +0000 Subject: [PATCH 23/41] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 479881b4..ca0f0b71 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-0d9b2038188e6e237e90e7d04144af0b48d60f006c49172ffb5e5c0151187d3b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-325fab92874fd04ae73a042c429db4cb6c98a934cff5cc4cb130b85b39a6538e.yml openapi_spec_hash: a37bbcbd9f496e5469be9a756bdaa0e9 config_hash: 625db64572b7ee0ee1dd00546e53fc5f From 75b292f49d849210de99330137f77f3a0e4e310e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 18:26:34 +0000 Subject: [PATCH 24/41] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ca0f0b71..8996ed04 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-325fab92874fd04ae73a042c429db4cb6c98a934cff5cc4cb130b85b39a6538e.yml -openapi_spec_hash: a37bbcbd9f496e5469be9a756bdaa0e9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-b04dec9fb30a417afb8b04537bfb32150e98d3b8071d17802e1ddbcf65253c1f.yml +openapi_spec_hash: cbbb7c70db84e7eb72c39a0400efd6f0 config_hash: 625db64572b7ee0ee1dd00546e53fc5f From 373e78b7f24449c77d98c0d05c897fdeb05641aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 00:28:53 +0000 Subject: [PATCH 25/41] feat(api): api update --- .stats.yml | 4 +-- lib/knockapi/models/message_event.rb | 22 ++++++------ rbi/knockapi/models/message_event.rbi | 52 +++++++++++++-------------- sig/knockapi/models/message_event.rbs | 44 +++++++++++------------ 4 files changed, 61 insertions(+), 61 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8996ed04..0aafda3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-b04dec9fb30a417afb8b04537bfb32150e98d3b8071d17802e1ddbcf65253c1f.yml -openapi_spec_hash: cbbb7c70db84e7eb72c39a0400efd6f0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-9574f16123ffa4f4b89e9ab4ff2f3276938d1f985c73aebfce8a74f2e07778a9.yml +openapi_spec_hash: b886eafe6bb5a3b78bb1e74b3f1ddda6 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 3f385976..3b63b1a6 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -66,22 +66,22 @@ class MessageEvent < Knockapi::Internal::Type::BaseModel module Type extend Knockapi::Internal::Type::Enum - MESSAGE_ARCHIVED = :"message.archived" - MESSAGE_BOUNCED = :"message.bounced" + MESSAGE_READ = :"message.read" + MESSAGE_SENT = :"message.sent" + MESSAGE_SEEN = :"message.seen" MESSAGE_CREATED = :"message.created" + MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" + MESSAGE_BOUNCED = :"message.bounced" + MESSAGE_UNDELIVERED = :"message.undelivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" - MESSAGE_INTERACTED = :"message.interacted" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" - MESSAGE_NOT_SENT = :"message.not_sent" - MESSAGE_QUEUED = :"message.queued" - MESSAGE_READ = :"message.read" - MESSAGE_SEEN = :"message.seen" - MESSAGE_SENT = :"message.sent" - MESSAGE_UNARCHIVED = :"message.unarchived" - MESSAGE_UNDELIVERED = :"message.undelivered" - MESSAGE_UNREAD = :"message.unread" + MESSAGE_INTERACTED = :"message.interacted" MESSAGE_UNSEEN = :"message.unseen" + MESSAGE_UNREAD = :"message.unread" + MESSAGE_UNARCHIVED = :"message.unarchived" # @!method self.values # @return [Array] diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index 2795fb47..e1f3b47e 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -89,56 +89,56 @@ module Knockapi T.type_alias { T.all(Symbol, Knockapi::MessageEvent::Type) } OrSymbol = T.type_alias { T.any(Symbol, String) } - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_BOUNCED = - T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_READ = + T.let(:"message.read", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_SENT = + T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_SEEN = + T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_CREATED = T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_QUEUED = + T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = T.let( :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_DELIVERY_ATTEMPTED = + MESSAGE_BOUNCED = + T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNDELIVERED = T.let( - :"message.delivery_attempted", + :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_INTERACTED = + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_DELIVERY_ATTEMPTED = T.let( - :"message.interacted", + :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_QUEUED = - T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_READ = - T.let(:"message.read", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_SEEN = - T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_SENT = - T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNARCHIVED = + MESSAGE_INTERACTED = T.let( - :"message.unarchived", + :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNDELIVERED = + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNARCHIVED = T.let( - :"message.undelivered", + :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index f283cac6..19ef4787 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -42,42 +42,42 @@ module Knockapi } type type_ = - :"message.archived" - | :"message.bounced" + :"message.read" + | :"message.sent" + | :"message.seen" | :"message.created" + | :"message.queued" | :"message.delivered" + | :"message.bounced" + | :"message.undelivered" + | :"message.not_sent" | :"message.delivery_attempted" - | :"message.interacted" + | :"message.archived" | :"message.link_clicked" - | :"message.not_sent" - | :"message.queued" - | :"message.read" - | :"message.seen" - | :"message.sent" - | :"message.unarchived" - | :"message.undelivered" - | :"message.unread" + | :"message.interacted" | :"message.unseen" + | :"message.unread" + | :"message.unarchived" module Type extend Knockapi::Internal::Type::Enum - MESSAGE_ARCHIVED: :"message.archived" - MESSAGE_BOUNCED: :"message.bounced" + MESSAGE_READ: :"message.read" + MESSAGE_SENT: :"message.sent" + MESSAGE_SEEN: :"message.seen" MESSAGE_CREATED: :"message.created" + MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" + MESSAGE_BOUNCED: :"message.bounced" + MESSAGE_UNDELIVERED: :"message.undelivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" - MESSAGE_INTERACTED: :"message.interacted" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" - MESSAGE_NOT_SENT: :"message.not_sent" - MESSAGE_QUEUED: :"message.queued" - MESSAGE_READ: :"message.read" - MESSAGE_SEEN: :"message.seen" - MESSAGE_SENT: :"message.sent" - MESSAGE_UNARCHIVED: :"message.unarchived" - MESSAGE_UNDELIVERED: :"message.undelivered" - MESSAGE_UNREAD: :"message.unread" + MESSAGE_INTERACTED: :"message.interacted" MESSAGE_UNSEEN: :"message.unseen" + MESSAGE_UNREAD: :"message.unread" + MESSAGE_UNARCHIVED: :"message.unarchived" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end From 8c8ac76f72d707f9e851a61e8fc5f850180d7d5a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 09:15:03 +0000 Subject: [PATCH 26/41] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0aafda3a..5a8198ba 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-9574f16123ffa4f4b89e9ab4ff2f3276938d1f985c73aebfce8a74f2e07778a9.yml -openapi_spec_hash: b886eafe6bb5a3b78bb1e74b3f1ddda6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-a330b08c7c525cff2693b98bf9418f370b35df8507a2338ea209e5c2cf508a1a.yml +openapi_spec_hash: 83312a96382ac5fc8cba616be474efe6 config_hash: 625db64572b7ee0ee1dd00546e53fc5f From 95ff0e32c7f4bb21b8a06d6404a0f22e9f8f4a81 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 19:08:22 +0000 Subject: [PATCH 27/41] ci: pin GitHub Actions to commit SHAs Pin all GitHub Actions referenced in generated workflows (both first-party `actions/*` and third-party) to immutable commit SHAs. Updating pinned actions is now a deliberate codegen-side bump rather than implicit on every workflow run. --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/publish-gem.yml | 4 ++-- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d297dbff..afdcca71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: github.repository == 'stainless-sdks/knock-ruby' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -39,7 +39,7 @@ jobs: github.repository == 'stainless-sdks/knock-ruby' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -60,9 +60,9 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -76,9 +76,9 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/knock-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 9d3dfc8b..448d28d2 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 3b8a1c88..28b9de73 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'knocklabs/knock-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | From 4e8b8cfd2dbdd693a880d960df5e48baa29fce2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 15:22:06 +0000 Subject: [PATCH 28/41] fix(client): elide content type header on requests without body --- lib/knockapi/internal/transport/base_client.rb | 2 ++ test/knockapi/client_test.rb | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/knockapi/internal/transport/base_client.rb b/lib/knockapi/internal/transport/base_client.rb index 3c41400d..c7d3a9b4 100644 --- a/lib/knockapi/internal/transport/base_client.rb +++ b/lib/knockapi/internal/transport/base_client.rb @@ -306,6 +306,8 @@ def initialize( Knockapi::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end + headers.delete("content-type") if body.nil? + url = Knockapi::Internal::Util.join_parsed_uri( @base_url_components, {**req, path: path, query: query} diff --git a/test/knockapi/client_test.rb b/test/knockapi/client_test.rb index 1c25365c..19dd72e5 100644 --- a/test/knockapi/client_test.rb +++ b/test/knockapi/client_test.rb @@ -200,8 +200,8 @@ def test_client_redirect_307 assert_equal(recorded.method, _1.method) assert_equal(recorded.body, _1.body) assert_equal( - recorded.headers.transform_keys(&:downcase).fetch("content-type"), - _1.headers.transform_keys(&:downcase).fetch("content-type") + recorded.headers.transform_keys(&:downcase)["content-type"], + _1.headers.transform_keys(&:downcase)["content-type"] ) end end @@ -324,8 +324,9 @@ def test_default_headers knock.users.get("user_id") assert_requested(:any, /./) do |req| - headers = req.headers.transform_keys(&:downcase).fetch_values("accept", "content-type") - headers.each { refute_empty(_1) } + headers = req.headers.transform_keys(&:downcase) + expected = req.body.nil? ? ["accept"] : %w[accept content-type] + headers.fetch_values(*expected).each { refute_empty(_1) } end end end From 98b0385d38c774d30b002d5ab34d73b9430e2086 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 07:12:34 +0000 Subject: [PATCH 29/41] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5a8198ba..a18062dc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-a330b08c7c525cff2693b98bf9418f370b35df8507a2338ea209e5c2cf508a1a.yml -openapi_spec_hash: 83312a96382ac5fc8cba616be474efe6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-1081b58ad42a969e5cd51e7c80d7e13fa5bf4973cbf1dfebbef4772caed7be80.yml +openapi_spec_hash: 58773164753990875fff9468a1f16429 config_hash: 625db64572b7ee0ee1dd00546e53fc5f From 76bdadc2b8b10eecfbe70ed14a8f6c040e27374e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 13:05:47 +0000 Subject: [PATCH 30/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/message_event.rb | 8 ++++---- rbi/knockapi/models/message_event.rbi | 20 ++++++++++---------- sig/knockapi/models/message_event.rbs | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index a18062dc..2607c389 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-1081b58ad42a969e5cd51e7c80d7e13fa5bf4973cbf1dfebbef4772caed7be80.yml -openapi_spec_hash: 58773164753990875fff9468a1f16429 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-369efa4602ed92c883669820ff3d099d97b6c7254c0ebc0028d462564144528d.yml +openapi_spec_hash: a8e129bcd0b0235a5b5d867212ccbe86 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 3b63b1a6..8df97396 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -69,19 +69,19 @@ module Type MESSAGE_READ = :"message.read" MESSAGE_SENT = :"message.sent" MESSAGE_SEEN = :"message.seen" - MESSAGE_CREATED = :"message.created" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_BOUNCED = :"message.bounced" MESSAGE_UNDELIVERED = :"message.undelivered" - MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" - MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" MESSAGE_INTERACTED = :"message.interacted" + MESSAGE_UNARCHIVED = :"message.unarchived" MESSAGE_UNSEEN = :"message.unseen" MESSAGE_UNREAD = :"message.unread" - MESSAGE_UNARCHIVED = :"message.unarchived" + MESSAGE_CREATED = :"message.created" # @!method self.values # @return [Array] diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index e1f3b47e..c0eb0d54 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -95,8 +95,8 @@ module Knockapi T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_SEEN = T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_CREATED = - T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = @@ -104,6 +104,8 @@ module Knockapi :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNDELIVERED = @@ -111,15 +113,11 @@ module Knockapi :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERY_ATTEMPTED = T.let( :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", @@ -130,15 +128,17 @@ module Knockapi :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNARCHIVED = T.let( :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_CREATED = + T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 19ef4787..3c8c64a5 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -45,19 +45,19 @@ module Knockapi :"message.read" | :"message.sent" | :"message.seen" - | :"message.created" + | :"message.archived" | :"message.queued" | :"message.delivered" + | :"message.not_sent" | :"message.bounced" | :"message.undelivered" - | :"message.not_sent" | :"message.delivery_attempted" - | :"message.archived" | :"message.link_clicked" | :"message.interacted" + | :"message.unarchived" | :"message.unseen" | :"message.unread" - | :"message.unarchived" + | :"message.created" module Type extend Knockapi::Internal::Type::Enum @@ -65,19 +65,19 @@ module Knockapi MESSAGE_READ: :"message.read" MESSAGE_SENT: :"message.sent" MESSAGE_SEEN: :"message.seen" - MESSAGE_CREATED: :"message.created" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_BOUNCED: :"message.bounced" MESSAGE_UNDELIVERED: :"message.undelivered" - MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" - MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" MESSAGE_INTERACTED: :"message.interacted" + MESSAGE_UNARCHIVED: :"message.unarchived" MESSAGE_UNSEEN: :"message.unseen" MESSAGE_UNREAD: :"message.unread" - MESSAGE_UNARCHIVED: :"message.unarchived" + MESSAGE_CREATED: :"message.created" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end From 2d54bf7fb14986bfcbe5a4f2cc4a797e65c8e670 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 15:22:47 +0000 Subject: [PATCH 31/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/message_event.rb | 8 ++++---- rbi/knockapi/models/message_event.rbi | 20 ++++++++++---------- sig/knockapi/models/message_event.rbs | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2607c389..a18062dc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-369efa4602ed92c883669820ff3d099d97b6c7254c0ebc0028d462564144528d.yml -openapi_spec_hash: a8e129bcd0b0235a5b5d867212ccbe86 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-1081b58ad42a969e5cd51e7c80d7e13fa5bf4973cbf1dfebbef4772caed7be80.yml +openapi_spec_hash: 58773164753990875fff9468a1f16429 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 8df97396..3b63b1a6 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -69,19 +69,19 @@ module Type MESSAGE_READ = :"message.read" MESSAGE_SENT = :"message.sent" MESSAGE_SEEN = :"message.seen" - MESSAGE_ARCHIVED = :"message.archived" + MESSAGE_CREATED = :"message.created" MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" - MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_BOUNCED = :"message.bounced" MESSAGE_UNDELIVERED = :"message.undelivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" MESSAGE_INTERACTED = :"message.interacted" - MESSAGE_UNARCHIVED = :"message.unarchived" MESSAGE_UNSEEN = :"message.unseen" MESSAGE_UNREAD = :"message.unread" - MESSAGE_CREATED = :"message.created" + MESSAGE_UNARCHIVED = :"message.unarchived" # @!method self.values # @return [Array] diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index c0eb0d54..e1f3b47e 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -95,8 +95,8 @@ module Knockapi T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_SEEN = T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_CREATED = + T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = @@ -104,8 +104,6 @@ module Knockapi :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNDELIVERED = @@ -113,11 +111,15 @@ module Knockapi :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERY_ATTEMPTED = T.let( :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", @@ -128,17 +130,15 @@ module Knockapi :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNARCHIVED = T.let( :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_CREATED = - T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 3c8c64a5..19ef4787 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -45,19 +45,19 @@ module Knockapi :"message.read" | :"message.sent" | :"message.seen" - | :"message.archived" + | :"message.created" | :"message.queued" | :"message.delivered" - | :"message.not_sent" | :"message.bounced" | :"message.undelivered" + | :"message.not_sent" | :"message.delivery_attempted" + | :"message.archived" | :"message.link_clicked" | :"message.interacted" - | :"message.unarchived" | :"message.unseen" | :"message.unread" - | :"message.created" + | :"message.unarchived" module Type extend Knockapi::Internal::Type::Enum @@ -65,19 +65,19 @@ module Knockapi MESSAGE_READ: :"message.read" MESSAGE_SENT: :"message.sent" MESSAGE_SEEN: :"message.seen" - MESSAGE_ARCHIVED: :"message.archived" + MESSAGE_CREATED: :"message.created" MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" - MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_BOUNCED: :"message.bounced" MESSAGE_UNDELIVERED: :"message.undelivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" MESSAGE_INTERACTED: :"message.interacted" - MESSAGE_UNARCHIVED: :"message.unarchived" MESSAGE_UNSEEN: :"message.unseen" MESSAGE_UNREAD: :"message.unread" - MESSAGE_CREATED: :"message.created" + MESSAGE_UNARCHIVED: :"message.unarchived" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end From 27e68a833d6045919ff9b61ee416cd65078c2aa3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 20:16:32 +0000 Subject: [PATCH 32/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/condition.rb | 1 + lib/knockapi/models/message_event.rb | 8 +++---- .../providers/ms_team_check_auth_response.rb | 10 ++++++++- rbi/knockapi/models/condition.rbi | 2 ++ rbi/knockapi/models/message_event.rbi | 20 ++++++++--------- .../providers/ms_team_check_auth_response.rbi | 22 +++++++++++++++---- sig/knockapi/models/condition.rbs | 2 ++ sig/knockapi/models/message_event.rbs | 16 +++++++------- .../providers/ms_team_check_auth_response.rbs | 19 ++++++++++++---- 10 files changed, 71 insertions(+), 33 deletions(-) diff --git a/.stats.yml b/.stats.yml index a18062dc..960ae3c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-1081b58ad42a969e5cd51e7c80d7e13fa5bf4973cbf1dfebbef4772caed7be80.yml -openapi_spec_hash: 58773164753990875fff9468a1f16429 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-6c3b72254f0f994d27c16100e3555edcc6001a3c986519567adcc51cdfe1261c.yml +openapi_spec_hash: 2e6ed3ff848d34fba88d965b06120fd4 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/condition.rb b/lib/knockapi/models/condition.rb index 9aad0aba..1639533a 100644 --- a/lib/knockapi/models/condition.rb +++ b/lib/knockapi/models/condition.rb @@ -49,6 +49,7 @@ module Operator EXISTS = :exists NOT_EXISTS = :not_exists CONTAINS_ALL = :contains_all + NOT_CONTAINS_ALL = :not_contains_all IS_TIMESTAMP = :is_timestamp IS_NOT_TIMESTAMP = :is_not_timestamp IS_TIMESTAMP_ON_OR_AFTER = :is_timestamp_on_or_after diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 3b63b1a6..8df97396 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -69,19 +69,19 @@ module Type MESSAGE_READ = :"message.read" MESSAGE_SENT = :"message.sent" MESSAGE_SEEN = :"message.seen" - MESSAGE_CREATED = :"message.created" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_BOUNCED = :"message.bounced" MESSAGE_UNDELIVERED = :"message.undelivered" - MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" - MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" MESSAGE_INTERACTED = :"message.interacted" + MESSAGE_UNARCHIVED = :"message.unarchived" MESSAGE_UNSEEN = :"message.unseen" MESSAGE_UNREAD = :"message.unread" - MESSAGE_UNARCHIVED = :"message.unarchived" + MESSAGE_CREATED = :"message.created" # @!method self.values # @return [Array] diff --git a/lib/knockapi/models/providers/ms_team_check_auth_response.rb b/lib/knockapi/models/providers/ms_team_check_auth_response.rb index 94961116..96833794 100644 --- a/lib/knockapi/models/providers/ms_team_check_auth_response.rb +++ b/lib/knockapi/models/providers/ms_team_check_auth_response.rb @@ -24,17 +24,25 @@ class Connection < Knockapi::Internal::Type::BaseModel # @return [Boolean] required :ok, Knockapi::Internal::Type::Boolean + # @!attribute ms_teams_tenant_id + # The Microsoft Teams tenant ID for the connected tenant. + # + # @return [String, nil] + optional :ms_teams_tenant_id, String, nil?: true + # @!attribute reason # The reason for the Microsoft Teams connection if it is not valid. # # @return [String, nil] optional :reason, String, nil?: true - # @!method initialize(ok:, reason: nil) + # @!method initialize(ok:, ms_teams_tenant_id: nil, reason: nil) # A Microsoft Teams connection object. # # @param ok [Boolean] Whether the Microsoft Teams connection is valid. # + # @param ms_teams_tenant_id [String, nil] The Microsoft Teams tenant ID for the connected tenant. + # # @param reason [String, nil] The reason for the Microsoft Teams connection if it is not valid. end end diff --git a/rbi/knockapi/models/condition.rbi b/rbi/knockapi/models/condition.rbi index f7f0d79f..c1f073fa 100644 --- a/rbi/knockapi/models/condition.rbi +++ b/rbi/knockapi/models/condition.rbi @@ -84,6 +84,8 @@ module Knockapi T.let(:not_exists, Knockapi::Condition::Operator::TaggedSymbol) CONTAINS_ALL = T.let(:contains_all, Knockapi::Condition::Operator::TaggedSymbol) + NOT_CONTAINS_ALL = + T.let(:not_contains_all, Knockapi::Condition::Operator::TaggedSymbol) IS_TIMESTAMP = T.let(:is_timestamp, Knockapi::Condition::Operator::TaggedSymbol) IS_NOT_TIMESTAMP = diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index e1f3b47e..c0eb0d54 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -95,8 +95,8 @@ module Knockapi T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_SEEN = T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_CREATED = - T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = @@ -104,6 +104,8 @@ module Knockapi :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNDELIVERED = @@ -111,15 +113,11 @@ module Knockapi :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERY_ATTEMPTED = T.let( :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", @@ -130,15 +128,17 @@ module Knockapi :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNARCHIVED = T.let( :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_CREATED = + T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi b/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi index d4e5e99e..92f23907 100644 --- a/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi +++ b/rbi/knockapi/models/providers/ms_team_check_auth_response.rbi @@ -65,26 +65,40 @@ module Knockapi sig { returns(T::Boolean) } attr_accessor :ok + # The Microsoft Teams tenant ID for the connected tenant. + sig { returns(T.nilable(String)) } + attr_accessor :ms_teams_tenant_id + # The reason for the Microsoft Teams connection if it is not valid. sig { returns(T.nilable(String)) } attr_accessor :reason # A Microsoft Teams connection object. sig do - params(ok: T::Boolean, reason: T.nilable(String)).returns( - T.attached_class - ) + params( + ok: T::Boolean, + ms_teams_tenant_id: T.nilable(String), + reason: T.nilable(String) + ).returns(T.attached_class) end def self.new( # Whether the Microsoft Teams connection is valid. ok:, + # The Microsoft Teams tenant ID for the connected tenant. + ms_teams_tenant_id: nil, # The reason for the Microsoft Teams connection if it is not valid. reason: nil ) end sig do - override.returns({ ok: T::Boolean, reason: T.nilable(String) }) + override.returns( + { + ok: T::Boolean, + ms_teams_tenant_id: T.nilable(String), + reason: T.nilable(String) + } + ) end def to_hash end diff --git a/sig/knockapi/models/condition.rbs b/sig/knockapi/models/condition.rbs index 872b85bc..4e7ec257 100644 --- a/sig/knockapi/models/condition.rbs +++ b/sig/knockapi/models/condition.rbs @@ -40,6 +40,7 @@ module Knockapi | :exists | :not_exists | :contains_all + | :not_contains_all | :is_timestamp | :is_not_timestamp | :is_timestamp_on_or_after @@ -67,6 +68,7 @@ module Knockapi EXISTS: :exists NOT_EXISTS: :not_exists CONTAINS_ALL: :contains_all + NOT_CONTAINS_ALL: :not_contains_all IS_TIMESTAMP: :is_timestamp IS_NOT_TIMESTAMP: :is_not_timestamp IS_TIMESTAMP_ON_OR_AFTER: :is_timestamp_on_or_after diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 19ef4787..3c8c64a5 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -45,19 +45,19 @@ module Knockapi :"message.read" | :"message.sent" | :"message.seen" - | :"message.created" + | :"message.archived" | :"message.queued" | :"message.delivered" + | :"message.not_sent" | :"message.bounced" | :"message.undelivered" - | :"message.not_sent" | :"message.delivery_attempted" - | :"message.archived" | :"message.link_clicked" | :"message.interacted" + | :"message.unarchived" | :"message.unseen" | :"message.unread" - | :"message.unarchived" + | :"message.created" module Type extend Knockapi::Internal::Type::Enum @@ -65,19 +65,19 @@ module Knockapi MESSAGE_READ: :"message.read" MESSAGE_SENT: :"message.sent" MESSAGE_SEEN: :"message.seen" - MESSAGE_CREATED: :"message.created" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_BOUNCED: :"message.bounced" MESSAGE_UNDELIVERED: :"message.undelivered" - MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" - MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" MESSAGE_INTERACTED: :"message.interacted" + MESSAGE_UNARCHIVED: :"message.unarchived" MESSAGE_UNSEEN: :"message.unseen" MESSAGE_UNREAD: :"message.unread" - MESSAGE_UNARCHIVED: :"message.unarchived" + MESSAGE_CREATED: :"message.created" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end diff --git a/sig/knockapi/models/providers/ms_team_check_auth_response.rbs b/sig/knockapi/models/providers/ms_team_check_auth_response.rbs index f63487d1..79d2642a 100644 --- a/sig/knockapi/models/providers/ms_team_check_auth_response.rbs +++ b/sig/knockapi/models/providers/ms_team_check_auth_response.rbs @@ -17,16 +17,27 @@ module Knockapi connection: Knockapi::Models::Providers::MsTeamCheckAuthResponse::Connection } - type connection = { ok: bool, reason: String? } + type connection = + { ok: bool, ms_teams_tenant_id: String?, reason: String? } class Connection < Knockapi::Internal::Type::BaseModel attr_accessor ok: bool - attr_accessor reason: String? + attr_accessor ms_teams_tenant_id: String? - def initialize: (ok: bool, ?reason: String?) -> void + attr_accessor reason: String? - def to_hash: -> { ok: bool, reason: String? } + def initialize: ( + ok: bool, + ?ms_teams_tenant_id: String?, + ?reason: String? + ) -> void + + def to_hash: -> { + ok: bool, + ms_teams_tenant_id: String?, + reason: String? + } end end end From cf13a4eac94e30e2bd0256af75cb9547057890aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 17:48:36 +0000 Subject: [PATCH 33/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/condition.rb | 1 - rbi/knockapi/models/condition.rbi | 2 -- sig/knockapi/models/condition.rbs | 2 -- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 960ae3c4..5c35c6d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-6c3b72254f0f994d27c16100e3555edcc6001a3c986519567adcc51cdfe1261c.yml -openapi_spec_hash: 2e6ed3ff848d34fba88d965b06120fd4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-49a6bd373e9b091c767273d512ca517d1452c1ab954230454534cab87a9e6a1b.yml +openapi_spec_hash: 7503066f9de54d7b8dbf50543b1b7929 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/condition.rb b/lib/knockapi/models/condition.rb index 1639533a..9aad0aba 100644 --- a/lib/knockapi/models/condition.rb +++ b/lib/knockapi/models/condition.rb @@ -49,7 +49,6 @@ module Operator EXISTS = :exists NOT_EXISTS = :not_exists CONTAINS_ALL = :contains_all - NOT_CONTAINS_ALL = :not_contains_all IS_TIMESTAMP = :is_timestamp IS_NOT_TIMESTAMP = :is_not_timestamp IS_TIMESTAMP_ON_OR_AFTER = :is_timestamp_on_or_after diff --git a/rbi/knockapi/models/condition.rbi b/rbi/knockapi/models/condition.rbi index c1f073fa..f7f0d79f 100644 --- a/rbi/knockapi/models/condition.rbi +++ b/rbi/knockapi/models/condition.rbi @@ -84,8 +84,6 @@ module Knockapi T.let(:not_exists, Knockapi::Condition::Operator::TaggedSymbol) CONTAINS_ALL = T.let(:contains_all, Knockapi::Condition::Operator::TaggedSymbol) - NOT_CONTAINS_ALL = - T.let(:not_contains_all, Knockapi::Condition::Operator::TaggedSymbol) IS_TIMESTAMP = T.let(:is_timestamp, Knockapi::Condition::Operator::TaggedSymbol) IS_NOT_TIMESTAMP = diff --git a/sig/knockapi/models/condition.rbs b/sig/knockapi/models/condition.rbs index 4e7ec257..872b85bc 100644 --- a/sig/knockapi/models/condition.rbs +++ b/sig/knockapi/models/condition.rbs @@ -40,7 +40,6 @@ module Knockapi | :exists | :not_exists | :contains_all - | :not_contains_all | :is_timestamp | :is_not_timestamp | :is_timestamp_on_or_after @@ -68,7 +67,6 @@ module Knockapi EXISTS: :exists NOT_EXISTS: :not_exists CONTAINS_ALL: :contains_all - NOT_CONTAINS_ALL: :not_contains_all IS_TIMESTAMP: :is_timestamp IS_NOT_TIMESTAMP: :is_not_timestamp IS_TIMESTAMP_ON_OR_AFTER: :is_timestamp_on_or_after From e697644fade546fea5be556f0f51024f8959228e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 31 May 2026 15:57:20 +0000 Subject: [PATCH 34/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/condition.rb | 1 + rbi/knockapi/models/condition.rbi | 2 ++ sig/knockapi/models/condition.rbs | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5c35c6d1..ceddeea3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-49a6bd373e9b091c767273d512ca517d1452c1ab954230454534cab87a9e6a1b.yml -openapi_spec_hash: 7503066f9de54d7b8dbf50543b1b7929 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-8ce4e8d1b89387fd949bbe362b3500d56e309e00d5ff2b94668c1d9f4c20776d.yml +openapi_spec_hash: 23febe31df8bbfdc3114ba2ce9b021ed config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/condition.rb b/lib/knockapi/models/condition.rb index 9aad0aba..1639533a 100644 --- a/lib/knockapi/models/condition.rb +++ b/lib/knockapi/models/condition.rb @@ -49,6 +49,7 @@ module Operator EXISTS = :exists NOT_EXISTS = :not_exists CONTAINS_ALL = :contains_all + NOT_CONTAINS_ALL = :not_contains_all IS_TIMESTAMP = :is_timestamp IS_NOT_TIMESTAMP = :is_not_timestamp IS_TIMESTAMP_ON_OR_AFTER = :is_timestamp_on_or_after diff --git a/rbi/knockapi/models/condition.rbi b/rbi/knockapi/models/condition.rbi index f7f0d79f..c1f073fa 100644 --- a/rbi/knockapi/models/condition.rbi +++ b/rbi/knockapi/models/condition.rbi @@ -84,6 +84,8 @@ module Knockapi T.let(:not_exists, Knockapi::Condition::Operator::TaggedSymbol) CONTAINS_ALL = T.let(:contains_all, Knockapi::Condition::Operator::TaggedSymbol) + NOT_CONTAINS_ALL = + T.let(:not_contains_all, Knockapi::Condition::Operator::TaggedSymbol) IS_TIMESTAMP = T.let(:is_timestamp, Knockapi::Condition::Operator::TaggedSymbol) IS_NOT_TIMESTAMP = diff --git a/sig/knockapi/models/condition.rbs b/sig/knockapi/models/condition.rbs index 872b85bc..4e7ec257 100644 --- a/sig/knockapi/models/condition.rbs +++ b/sig/knockapi/models/condition.rbs @@ -40,6 +40,7 @@ module Knockapi | :exists | :not_exists | :contains_all + | :not_contains_all | :is_timestamp | :is_not_timestamp | :is_timestamp_on_or_after @@ -67,6 +68,7 @@ module Knockapi EXISTS: :exists NOT_EXISTS: :not_exists CONTAINS_ALL: :contains_all + NOT_CONTAINS_ALL: :not_contains_all IS_TIMESTAMP: :is_timestamp IS_NOT_TIMESTAMP: :is_not_timestamp IS_TIMESTAMP_ON_OR_AFTER: :is_timestamp_on_or_after From e2d7908ccc094c06989d5f78c620ea8b6bdff6f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 14:17:32 +0000 Subject: [PATCH 35/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/message_event.rb | 8 ++++---- rbi/knockapi/models/message_event.rbi | 20 ++++++++++---------- sig/knockapi/models/message_event.rbs | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index ceddeea3..e8408541 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-8ce4e8d1b89387fd949bbe362b3500d56e309e00d5ff2b94668c1d9f4c20776d.yml -openapi_spec_hash: 23febe31df8bbfdc3114ba2ce9b021ed +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-304901d28dd866d97329d1fb246d952d00ba02bf8f509f03853f4b532fff1f5c.yml +openapi_spec_hash: da37e7d9f9375fda003a900acb408da7 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 8df97396..3b63b1a6 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -69,19 +69,19 @@ module Type MESSAGE_READ = :"message.read" MESSAGE_SENT = :"message.sent" MESSAGE_SEEN = :"message.seen" - MESSAGE_ARCHIVED = :"message.archived" + MESSAGE_CREATED = :"message.created" MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" - MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_BOUNCED = :"message.bounced" MESSAGE_UNDELIVERED = :"message.undelivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" MESSAGE_INTERACTED = :"message.interacted" - MESSAGE_UNARCHIVED = :"message.unarchived" MESSAGE_UNSEEN = :"message.unseen" MESSAGE_UNREAD = :"message.unread" - MESSAGE_CREATED = :"message.created" + MESSAGE_UNARCHIVED = :"message.unarchived" # @!method self.values # @return [Array] diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index c0eb0d54..e1f3b47e 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -95,8 +95,8 @@ module Knockapi T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_SEEN = T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_CREATED = + T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = @@ -104,8 +104,6 @@ module Knockapi :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNDELIVERED = @@ -113,11 +111,15 @@ module Knockapi :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERY_ATTEMPTED = T.let( :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", @@ -128,17 +130,15 @@ module Knockapi :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNARCHIVED = T.let( :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_CREATED = - T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 3c8c64a5..19ef4787 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -45,19 +45,19 @@ module Knockapi :"message.read" | :"message.sent" | :"message.seen" - | :"message.archived" + | :"message.created" | :"message.queued" | :"message.delivered" - | :"message.not_sent" | :"message.bounced" | :"message.undelivered" + | :"message.not_sent" | :"message.delivery_attempted" + | :"message.archived" | :"message.link_clicked" | :"message.interacted" - | :"message.unarchived" | :"message.unseen" | :"message.unread" - | :"message.created" + | :"message.unarchived" module Type extend Knockapi::Internal::Type::Enum @@ -65,19 +65,19 @@ module Knockapi MESSAGE_READ: :"message.read" MESSAGE_SENT: :"message.sent" MESSAGE_SEEN: :"message.seen" - MESSAGE_ARCHIVED: :"message.archived" + MESSAGE_CREATED: :"message.created" MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" - MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_BOUNCED: :"message.bounced" MESSAGE_UNDELIVERED: :"message.undelivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" MESSAGE_INTERACTED: :"message.interacted" - MESSAGE_UNARCHIVED: :"message.unarchived" MESSAGE_UNSEEN: :"message.unseen" MESSAGE_UNREAD: :"message.unread" - MESSAGE_CREATED: :"message.created" + MESSAGE_UNARCHIVED: :"message.unarchived" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end From e119cef6b64fbeb3eda95e1a9418cdc5d058cd35 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 14:36:02 +0000 Subject: [PATCH 36/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/message_event.rb | 8 ++++---- rbi/knockapi/models/message_event.rbi | 20 ++++++++++---------- sig/knockapi/models/message_event.rbs | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index e8408541..ceddeea3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-304901d28dd866d97329d1fb246d952d00ba02bf8f509f03853f4b532fff1f5c.yml -openapi_spec_hash: da37e7d9f9375fda003a900acb408da7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-8ce4e8d1b89387fd949bbe362b3500d56e309e00d5ff2b94668c1d9f4c20776d.yml +openapi_spec_hash: 23febe31df8bbfdc3114ba2ce9b021ed config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 3b63b1a6..8df97396 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -69,19 +69,19 @@ module Type MESSAGE_READ = :"message.read" MESSAGE_SENT = :"message.sent" MESSAGE_SEEN = :"message.seen" - MESSAGE_CREATED = :"message.created" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_BOUNCED = :"message.bounced" MESSAGE_UNDELIVERED = :"message.undelivered" - MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" - MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" MESSAGE_INTERACTED = :"message.interacted" + MESSAGE_UNARCHIVED = :"message.unarchived" MESSAGE_UNSEEN = :"message.unseen" MESSAGE_UNREAD = :"message.unread" - MESSAGE_UNARCHIVED = :"message.unarchived" + MESSAGE_CREATED = :"message.created" # @!method self.values # @return [Array] diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index e1f3b47e..c0eb0d54 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -95,8 +95,8 @@ module Knockapi T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_SEEN = T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_CREATED = - T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = @@ -104,6 +104,8 @@ module Knockapi :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNDELIVERED = @@ -111,15 +113,11 @@ module Knockapi :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERY_ATTEMPTED = T.let( :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", @@ -130,15 +128,17 @@ module Knockapi :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNARCHIVED = T.let( :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_CREATED = + T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 19ef4787..3c8c64a5 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -45,19 +45,19 @@ module Knockapi :"message.read" | :"message.sent" | :"message.seen" - | :"message.created" + | :"message.archived" | :"message.queued" | :"message.delivered" + | :"message.not_sent" | :"message.bounced" | :"message.undelivered" - | :"message.not_sent" | :"message.delivery_attempted" - | :"message.archived" | :"message.link_clicked" | :"message.interacted" + | :"message.unarchived" | :"message.unseen" | :"message.unread" - | :"message.unarchived" + | :"message.created" module Type extend Knockapi::Internal::Type::Enum @@ -65,19 +65,19 @@ module Knockapi MESSAGE_READ: :"message.read" MESSAGE_SENT: :"message.sent" MESSAGE_SEEN: :"message.seen" - MESSAGE_CREATED: :"message.created" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_BOUNCED: :"message.bounced" MESSAGE_UNDELIVERED: :"message.undelivered" - MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" - MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" MESSAGE_INTERACTED: :"message.interacted" + MESSAGE_UNARCHIVED: :"message.unarchived" MESSAGE_UNSEEN: :"message.unseen" MESSAGE_UNREAD: :"message.unread" - MESSAGE_UNARCHIVED: :"message.unarchived" + MESSAGE_CREATED: :"message.created" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end From 5c3a9c12f02fb3acbe8263f07dc7fb5d2134fc98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:34:22 +0000 Subject: [PATCH 37/41] feat(api): api update --- .stats.yml | 4 +- lib/knockapi/models/message.rb | 34 +++++++++++++- rbi/knockapi/models/message.rbi | 59 ++++++++++++++++++++++++ sig/knockapi/models/message.rbs | 19 ++++++++ test/knockapi/resources/messages_test.rb | 9 ++++ test/knockapi/resources/objects_test.rb | 1 + test/knockapi/resources/users_test.rb | 1 + 7 files changed, 124 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ceddeea3..903c5349 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-8ce4e8d1b89387fd949bbe362b3500d56e309e00d5ff2b94668c1d9f4c20776d.yml -openapi_spec_hash: 23febe31df8bbfdc3114ba2ce9b021ed +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-5510d088175a14cf0d6fe117b42ba6e4dc898cd87ea89c76ccac0c8f1f75077e.yml +openapi_spec_hash: a39cd215c648ae625d0f68b05fcc7cde config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message.rb b/lib/knockapi/models/message.rb index b8ff0cf6..72cf18be 100644 --- a/lib/knockapi/models/message.rb +++ b/lib/knockapi/models/message.rb @@ -122,6 +122,13 @@ class Message < Knockapi::Internal::Type::BaseModel # @return [Time, nil] optional :read_at, Time, nil?: true + # @!attribute recipient_snapshot + # Recipient contact information captured at email send time. Null for non-email + # channels. + # + # @return [Knockapi::Models::Message::RecipientSnapshot, nil] + optional :recipient_snapshot, -> { Knockapi::Message::RecipientSnapshot }, nil?: true + # @!attribute scheduled_at # Timestamp when the message was scheduled to be sent. # @@ -149,7 +156,7 @@ class Message < Knockapi::Internal::Type::BaseModel # @return [String, nil] optional :workflow, String, nil?: true - # @!method initialize(id:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, channel: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil) + # @!method initialize(id:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, channel: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, recipient_snapshot: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil) # Some parameter documentations has been truncated, see # {Knockapi::Models::Message} for more details. # @@ -192,6 +199,8 @@ class Message < Knockapi::Internal::Type::BaseModel # # @param read_at [Time, nil] Timestamp when the message was read. # + # @param recipient_snapshot [Knockapi::Models::Message::RecipientSnapshot, nil] Recipient contact information captured at email send time. Null for non-email ch + # # @param scheduled_at [Time, nil] Timestamp when the message was scheduled to be sent. # # @param seen_at [Time, nil] Timestamp when the message was seen. @@ -401,6 +410,29 @@ module Type # @return [Array] end end + + # @see Knockapi::Models::Message#recipient_snapshot + class RecipientSnapshot < Knockapi::Internal::Type::BaseModel + # @!attribute email + # The email address the message was delivered to + # + # @return [String, nil] + optional :email, String + + # @!attribute name + # The recipient name at send time + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!method initialize(email: nil, name: nil) + # Recipient contact information captured at email send time. Null for non-email + # channels. + # + # @param email [String] The email address the message was delivered to + # + # @param name [String, nil] The recipient name at send time + end end end end diff --git a/rbi/knockapi/models/message.rbi b/rbi/knockapi/models/message.rbi index 7702b312..22404362 100644 --- a/rbi/knockapi/models/message.rbi +++ b/rbi/knockapi/models/message.rbi @@ -108,6 +108,19 @@ module Knockapi sig { returns(T.nilable(Time)) } attr_accessor :read_at + # Recipient contact information captured at email send time. Null for non-email + # channels. + sig { returns(T.nilable(Knockapi::Message::RecipientSnapshot)) } + attr_reader :recipient_snapshot + + sig do + params( + recipient_snapshot: + T.nilable(Knockapi::Message::RecipientSnapshot::OrHash) + ).void + end + attr_writer :recipient_snapshot + # Timestamp when the message was scheduled to be sent. sig { returns(T.nilable(Time)) } attr_accessor :scheduled_at @@ -158,6 +171,8 @@ module Knockapi link_clicked_at: T.nilable(Time), metadata: T.nilable(T::Hash[Symbol, T.anything]), read_at: T.nilable(Time), + recipient_snapshot: + T.nilable(Knockapi::Message::RecipientSnapshot::OrHash), scheduled_at: T.nilable(Time), seen_at: T.nilable(Time), tenant: T.nilable(String), @@ -208,6 +223,9 @@ module Knockapi metadata: nil, # Timestamp when the message was read. read_at: nil, + # Recipient contact information captured at email send time. Null for non-email + # channels. + recipient_snapshot: nil, # Timestamp when the message was scheduled to be sent. scheduled_at: nil, # Timestamp when the message was seen. @@ -242,6 +260,7 @@ module Knockapi link_clicked_at: T.nilable(Time), metadata: T.nilable(T::Hash[Symbol, T.anything]), read_at: T.nilable(Time), + recipient_snapshot: T.nilable(Knockapi::Message::RecipientSnapshot), scheduled_at: T.nilable(Time), seen_at: T.nilable(Time), tenant: T.nilable(String), @@ -534,6 +553,46 @@ module Knockapi end end end + + class RecipientSnapshot < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Message::RecipientSnapshot, + Knockapi::Internal::AnyHash + ) + end + + # The email address the message was delivered to + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The recipient name at send time + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Recipient contact information captured at email send time. Null for non-email + # channels. + sig do + params(email: String, name: T.nilable(String)).returns( + T.attached_class + ) + end + def self.new( + # The email address the message was delivered to + email: nil, + # The recipient name at send time + name: nil + ) + end + + sig { override.returns({ email: String, name: T.nilable(String) }) } + def to_hash + end + end end end end diff --git a/sig/knockapi/models/message.rbs b/sig/knockapi/models/message.rbs index 286c2885..6dc71d2d 100644 --- a/sig/knockapi/models/message.rbs +++ b/sig/knockapi/models/message.rbs @@ -20,6 +20,7 @@ module Knockapi link_clicked_at: Time?, metadata: ::Hash[Symbol, top]?, read_at: Time?, + recipient_snapshot: Knockapi::Message::RecipientSnapshot?, scheduled_at: Time?, seen_at: Time?, tenant: String?, @@ -69,6 +70,8 @@ module Knockapi attr_accessor read_at: Time? + attr_accessor recipient_snapshot: Knockapi::Message::RecipientSnapshot? + attr_accessor scheduled_at: Time? attr_accessor seen_at: Time? @@ -96,6 +99,7 @@ module Knockapi ?link_clicked_at: Time?, ?metadata: ::Hash[Symbol, top]?, ?read_at: Time?, + ?recipient_snapshot: Knockapi::Message::RecipientSnapshot?, ?scheduled_at: Time?, ?seen_at: Time?, ?tenant: String?, @@ -121,6 +125,7 @@ module Knockapi link_clicked_at: Time?, metadata: ::Hash[Symbol, top]?, read_at: Time?, + recipient_snapshot: Knockapi::Message::RecipientSnapshot?, scheduled_at: Time?, seen_at: Time?, tenant: String?, @@ -304,6 +309,20 @@ module Knockapi def self?.values: -> ::Array[Knockapi::Models::Message::Channel::type_] end end + + type recipient_snapshot = { email: String, name: String? } + + class RecipientSnapshot < Knockapi::Internal::Type::BaseModel + attr_reader email: String? + + def email=: (String) -> String + + attr_accessor name: String? + + def initialize: (?email: String, ?name: String?) -> void + + def to_hash: -> { email: String, name: String? } + end end end end diff --git a/test/knockapi/resources/messages_test.rb b/test/knockapi/resources/messages_test.rb index 4aa46866..e3ae5178 100644 --- a/test/knockapi/resources/messages_test.rb +++ b/test/knockapi/resources/messages_test.rb @@ -37,6 +37,7 @@ def test_list link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -72,6 +73,7 @@ def test_archive link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -107,6 +109,7 @@ def test_get link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -239,6 +242,7 @@ def test_mark_as_interacted link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -274,6 +278,7 @@ def test_mark_as_read link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -309,6 +314,7 @@ def test_mark_as_seen link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -344,6 +350,7 @@ def test_mark_as_unread link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -379,6 +386,7 @@ def test_mark_as_unseen link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -414,6 +422,7 @@ def test_unarchive link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, diff --git a/test/knockapi/resources/objects_test.rb b/test/knockapi/resources/objects_test.rb index da6524f5..221d1775 100644 --- a/test/knockapi/resources/objects_test.rb +++ b/test/knockapi/resources/objects_test.rb @@ -143,6 +143,7 @@ def test_list_messages link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, diff --git a/test/knockapi/resources/users_test.rb b/test/knockapi/resources/users_test.rb index 44bd2037..1cc09dce 100644 --- a/test/knockapi/resources/users_test.rb +++ b/test/knockapi/resources/users_test.rb @@ -154,6 +154,7 @@ def test_list_messages link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, From 235f220522da41f5ec8f589858879e1885d8be67 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 10:23:05 +0000 Subject: [PATCH 38/41] feat(api): api update --- .stats.yml | 4 ++-- lib/knockapi/models/message_event.rb | 8 ++++---- rbi/knockapi/models/message_event.rbi | 20 ++++++++++---------- sig/knockapi/models/message_event.rbs | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index 903c5349..8eaa5936 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-5510d088175a14cf0d6fe117b42ba6e4dc898cd87ea89c76ccac0c8f1f75077e.yml -openapi_spec_hash: a39cd215c648ae625d0f68b05fcc7cde +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-af9ca6816ceac17bfac3ab8eb9abee761db04252f4195b0b466bc31d3bb4be6c.yml +openapi_spec_hash: 966e424d276460ac50dc3d974a3773d6 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 8df97396..3b63b1a6 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -69,19 +69,19 @@ module Type MESSAGE_READ = :"message.read" MESSAGE_SENT = :"message.sent" MESSAGE_SEEN = :"message.seen" - MESSAGE_ARCHIVED = :"message.archived" + MESSAGE_CREATED = :"message.created" MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" - MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_BOUNCED = :"message.bounced" MESSAGE_UNDELIVERED = :"message.undelivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" MESSAGE_INTERACTED = :"message.interacted" - MESSAGE_UNARCHIVED = :"message.unarchived" MESSAGE_UNSEEN = :"message.unseen" MESSAGE_UNREAD = :"message.unread" - MESSAGE_CREATED = :"message.created" + MESSAGE_UNARCHIVED = :"message.unarchived" # @!method self.values # @return [Array] diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index c0eb0d54..e1f3b47e 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -95,8 +95,8 @@ module Knockapi T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_SEEN = T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_CREATED = + T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = @@ -104,8 +104,6 @@ module Knockapi :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNDELIVERED = @@ -113,11 +111,15 @@ module Knockapi :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERY_ATTEMPTED = T.let( :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", @@ -128,17 +130,15 @@ module Knockapi :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNARCHIVED = T.let( :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_CREATED = - T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 3c8c64a5..19ef4787 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -45,19 +45,19 @@ module Knockapi :"message.read" | :"message.sent" | :"message.seen" - | :"message.archived" + | :"message.created" | :"message.queued" | :"message.delivered" - | :"message.not_sent" | :"message.bounced" | :"message.undelivered" + | :"message.not_sent" | :"message.delivery_attempted" + | :"message.archived" | :"message.link_clicked" | :"message.interacted" - | :"message.unarchived" | :"message.unseen" | :"message.unread" - | :"message.created" + | :"message.unarchived" module Type extend Knockapi::Internal::Type::Enum @@ -65,19 +65,19 @@ module Knockapi MESSAGE_READ: :"message.read" MESSAGE_SENT: :"message.sent" MESSAGE_SEEN: :"message.seen" - MESSAGE_ARCHIVED: :"message.archived" + MESSAGE_CREATED: :"message.created" MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" - MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_BOUNCED: :"message.bounced" MESSAGE_UNDELIVERED: :"message.undelivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" MESSAGE_INTERACTED: :"message.interacted" - MESSAGE_UNARCHIVED: :"message.unarchived" MESSAGE_UNSEEN: :"message.unseen" MESSAGE_UNREAD: :"message.unread" - MESSAGE_CREATED: :"message.created" + MESSAGE_UNARCHIVED: :"message.unarchived" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end From 3c57fe3e021d0c7ce2670d03d4666205458397da Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 14:31:58 +0000 Subject: [PATCH 39/41] feat(api): api update --- .stats.yml | 4 +- lib/knockapi/models/message.rb | 34 +------------- lib/knockapi/models/message_event.rb | 8 ++-- rbi/knockapi/models/message.rbi | 59 ------------------------ rbi/knockapi/models/message_event.rbi | 20 ++++---- sig/knockapi/models/message.rbs | 19 -------- sig/knockapi/models/message_event.rbs | 16 +++---- test/knockapi/resources/messages_test.rb | 9 ---- test/knockapi/resources/objects_test.rb | 1 - test/knockapi/resources/users_test.rb | 1 - 10 files changed, 25 insertions(+), 146 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8eaa5936..ceddeea3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-af9ca6816ceac17bfac3ab8eb9abee761db04252f4195b0b466bc31d3bb4be6c.yml -openapi_spec_hash: 966e424d276460ac50dc3d974a3773d6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-8ce4e8d1b89387fd949bbe362b3500d56e309e00d5ff2b94668c1d9f4c20776d.yml +openapi_spec_hash: 23febe31df8bbfdc3114ba2ce9b021ed config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message.rb b/lib/knockapi/models/message.rb index 72cf18be..b8ff0cf6 100644 --- a/lib/knockapi/models/message.rb +++ b/lib/knockapi/models/message.rb @@ -122,13 +122,6 @@ class Message < Knockapi::Internal::Type::BaseModel # @return [Time, nil] optional :read_at, Time, nil?: true - # @!attribute recipient_snapshot - # Recipient contact information captured at email send time. Null for non-email - # channels. - # - # @return [Knockapi::Models::Message::RecipientSnapshot, nil] - optional :recipient_snapshot, -> { Knockapi::Message::RecipientSnapshot }, nil?: true - # @!attribute scheduled_at # Timestamp when the message was scheduled to be sent. # @@ -156,7 +149,7 @@ class Message < Knockapi::Internal::Type::BaseModel # @return [String, nil] optional :workflow, String, nil?: true - # @!method initialize(id:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, channel: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, recipient_snapshot: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil) + # @!method initialize(id:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, channel: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil) # Some parameter documentations has been truncated, see # {Knockapi::Models::Message} for more details. # @@ -199,8 +192,6 @@ class Message < Knockapi::Internal::Type::BaseModel # # @param read_at [Time, nil] Timestamp when the message was read. # - # @param recipient_snapshot [Knockapi::Models::Message::RecipientSnapshot, nil] Recipient contact information captured at email send time. Null for non-email ch - # # @param scheduled_at [Time, nil] Timestamp when the message was scheduled to be sent. # # @param seen_at [Time, nil] Timestamp when the message was seen. @@ -410,29 +401,6 @@ module Type # @return [Array] end end - - # @see Knockapi::Models::Message#recipient_snapshot - class RecipientSnapshot < Knockapi::Internal::Type::BaseModel - # @!attribute email - # The email address the message was delivered to - # - # @return [String, nil] - optional :email, String - - # @!attribute name - # The recipient name at send time - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!method initialize(email: nil, name: nil) - # Recipient contact information captured at email send time. Null for non-email - # channels. - # - # @param email [String] The email address the message was delivered to - # - # @param name [String, nil] The recipient name at send time - end end end end diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 3b63b1a6..8df97396 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -69,19 +69,19 @@ module Type MESSAGE_READ = :"message.read" MESSAGE_SENT = :"message.sent" MESSAGE_SEEN = :"message.seen" - MESSAGE_CREATED = :"message.created" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_BOUNCED = :"message.bounced" MESSAGE_UNDELIVERED = :"message.undelivered" - MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" - MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" MESSAGE_INTERACTED = :"message.interacted" + MESSAGE_UNARCHIVED = :"message.unarchived" MESSAGE_UNSEEN = :"message.unseen" MESSAGE_UNREAD = :"message.unread" - MESSAGE_UNARCHIVED = :"message.unarchived" + MESSAGE_CREATED = :"message.created" # @!method self.values # @return [Array] diff --git a/rbi/knockapi/models/message.rbi b/rbi/knockapi/models/message.rbi index 22404362..7702b312 100644 --- a/rbi/knockapi/models/message.rbi +++ b/rbi/knockapi/models/message.rbi @@ -108,19 +108,6 @@ module Knockapi sig { returns(T.nilable(Time)) } attr_accessor :read_at - # Recipient contact information captured at email send time. Null for non-email - # channels. - sig { returns(T.nilable(Knockapi::Message::RecipientSnapshot)) } - attr_reader :recipient_snapshot - - sig do - params( - recipient_snapshot: - T.nilable(Knockapi::Message::RecipientSnapshot::OrHash) - ).void - end - attr_writer :recipient_snapshot - # Timestamp when the message was scheduled to be sent. sig { returns(T.nilable(Time)) } attr_accessor :scheduled_at @@ -171,8 +158,6 @@ module Knockapi link_clicked_at: T.nilable(Time), metadata: T.nilable(T::Hash[Symbol, T.anything]), read_at: T.nilable(Time), - recipient_snapshot: - T.nilable(Knockapi::Message::RecipientSnapshot::OrHash), scheduled_at: T.nilable(Time), seen_at: T.nilable(Time), tenant: T.nilable(String), @@ -223,9 +208,6 @@ module Knockapi metadata: nil, # Timestamp when the message was read. read_at: nil, - # Recipient contact information captured at email send time. Null for non-email - # channels. - recipient_snapshot: nil, # Timestamp when the message was scheduled to be sent. scheduled_at: nil, # Timestamp when the message was seen. @@ -260,7 +242,6 @@ module Knockapi link_clicked_at: T.nilable(Time), metadata: T.nilable(T::Hash[Symbol, T.anything]), read_at: T.nilable(Time), - recipient_snapshot: T.nilable(Knockapi::Message::RecipientSnapshot), scheduled_at: T.nilable(Time), seen_at: T.nilable(Time), tenant: T.nilable(String), @@ -553,46 +534,6 @@ module Knockapi end end end - - class RecipientSnapshot < Knockapi::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Knockapi::Message::RecipientSnapshot, - Knockapi::Internal::AnyHash - ) - end - - # The email address the message was delivered to - sig { returns(T.nilable(String)) } - attr_reader :email - - sig { params(email: String).void } - attr_writer :email - - # The recipient name at send time - sig { returns(T.nilable(String)) } - attr_accessor :name - - # Recipient contact information captured at email send time. Null for non-email - # channels. - sig do - params(email: String, name: T.nilable(String)).returns( - T.attached_class - ) - end - def self.new( - # The email address the message was delivered to - email: nil, - # The recipient name at send time - name: nil - ) - end - - sig { override.returns({ email: String, name: T.nilable(String) }) } - def to_hash - end - end end end end diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index e1f3b47e..c0eb0d54 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -95,8 +95,8 @@ module Knockapi T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_SEEN = T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_CREATED = - T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = @@ -104,6 +104,8 @@ module Knockapi :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNDELIVERED = @@ -111,15 +113,11 @@ module Knockapi :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERY_ATTEMPTED = T.let( :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", @@ -130,15 +128,17 @@ module Knockapi :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNARCHIVED = T.let( :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_CREATED = + T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/sig/knockapi/models/message.rbs b/sig/knockapi/models/message.rbs index 6dc71d2d..286c2885 100644 --- a/sig/knockapi/models/message.rbs +++ b/sig/knockapi/models/message.rbs @@ -20,7 +20,6 @@ module Knockapi link_clicked_at: Time?, metadata: ::Hash[Symbol, top]?, read_at: Time?, - recipient_snapshot: Knockapi::Message::RecipientSnapshot?, scheduled_at: Time?, seen_at: Time?, tenant: String?, @@ -70,8 +69,6 @@ module Knockapi attr_accessor read_at: Time? - attr_accessor recipient_snapshot: Knockapi::Message::RecipientSnapshot? - attr_accessor scheduled_at: Time? attr_accessor seen_at: Time? @@ -99,7 +96,6 @@ module Knockapi ?link_clicked_at: Time?, ?metadata: ::Hash[Symbol, top]?, ?read_at: Time?, - ?recipient_snapshot: Knockapi::Message::RecipientSnapshot?, ?scheduled_at: Time?, ?seen_at: Time?, ?tenant: String?, @@ -125,7 +121,6 @@ module Knockapi link_clicked_at: Time?, metadata: ::Hash[Symbol, top]?, read_at: Time?, - recipient_snapshot: Knockapi::Message::RecipientSnapshot?, scheduled_at: Time?, seen_at: Time?, tenant: String?, @@ -309,20 +304,6 @@ module Knockapi def self?.values: -> ::Array[Knockapi::Models::Message::Channel::type_] end end - - type recipient_snapshot = { email: String, name: String? } - - class RecipientSnapshot < Knockapi::Internal::Type::BaseModel - attr_reader email: String? - - def email=: (String) -> String - - attr_accessor name: String? - - def initialize: (?email: String, ?name: String?) -> void - - def to_hash: -> { email: String, name: String? } - end end end end diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 19ef4787..3c8c64a5 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -45,19 +45,19 @@ module Knockapi :"message.read" | :"message.sent" | :"message.seen" - | :"message.created" + | :"message.archived" | :"message.queued" | :"message.delivered" + | :"message.not_sent" | :"message.bounced" | :"message.undelivered" - | :"message.not_sent" | :"message.delivery_attempted" - | :"message.archived" | :"message.link_clicked" | :"message.interacted" + | :"message.unarchived" | :"message.unseen" | :"message.unread" - | :"message.unarchived" + | :"message.created" module Type extend Knockapi::Internal::Type::Enum @@ -65,19 +65,19 @@ module Knockapi MESSAGE_READ: :"message.read" MESSAGE_SENT: :"message.sent" MESSAGE_SEEN: :"message.seen" - MESSAGE_CREATED: :"message.created" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_BOUNCED: :"message.bounced" MESSAGE_UNDELIVERED: :"message.undelivered" - MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" - MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" MESSAGE_INTERACTED: :"message.interacted" + MESSAGE_UNARCHIVED: :"message.unarchived" MESSAGE_UNSEEN: :"message.unseen" MESSAGE_UNREAD: :"message.unread" - MESSAGE_UNARCHIVED: :"message.unarchived" + MESSAGE_CREATED: :"message.created" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end diff --git a/test/knockapi/resources/messages_test.rb b/test/knockapi/resources/messages_test.rb index e3ae5178..4aa46866 100644 --- a/test/knockapi/resources/messages_test.rb +++ b/test/knockapi/resources/messages_test.rb @@ -37,7 +37,6 @@ def test_list link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -73,7 +72,6 @@ def test_archive link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -109,7 +107,6 @@ def test_get link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -242,7 +239,6 @@ def test_mark_as_interacted link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -278,7 +274,6 @@ def test_mark_as_read link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -314,7 +309,6 @@ def test_mark_as_seen link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -350,7 +344,6 @@ def test_mark_as_unread link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -386,7 +379,6 @@ def test_mark_as_unseen link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -422,7 +414,6 @@ def test_unarchive link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, diff --git a/test/knockapi/resources/objects_test.rb b/test/knockapi/resources/objects_test.rb index 221d1775..da6524f5 100644 --- a/test/knockapi/resources/objects_test.rb +++ b/test/knockapi/resources/objects_test.rb @@ -143,7 +143,6 @@ def test_list_messages link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, diff --git a/test/knockapi/resources/users_test.rb b/test/knockapi/resources/users_test.rb index 1cc09dce..44bd2037 100644 --- a/test/knockapi/resources/users_test.rb +++ b/test/knockapi/resources/users_test.rb @@ -154,7 +154,6 @@ def test_list_messages link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, - recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, From 692eda92f04365b34921069ea4ceee12996dc562 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 15:51:17 +0000 Subject: [PATCH 40/41] feat(api): api update --- .stats.yml | 4 +- lib/knockapi/models/message.rb | 34 +++++++++++++- lib/knockapi/models/message_event.rb | 8 ++-- rbi/knockapi/models/message.rbi | 59 ++++++++++++++++++++++++ rbi/knockapi/models/message_event.rbi | 20 ++++---- sig/knockapi/models/message.rbs | 19 ++++++++ sig/knockapi/models/message_event.rbs | 16 +++---- test/knockapi/resources/messages_test.rb | 9 ++++ test/knockapi/resources/objects_test.rb | 1 + test/knockapi/resources/users_test.rb | 1 + 10 files changed, 146 insertions(+), 25 deletions(-) diff --git a/.stats.yml b/.stats.yml index ceddeea3..8eaa5936 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-8ce4e8d1b89387fd949bbe362b3500d56e309e00d5ff2b94668c1d9f4c20776d.yml -openapi_spec_hash: 23febe31df8bbfdc3114ba2ce9b021ed +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock/knock-af9ca6816ceac17bfac3ab8eb9abee761db04252f4195b0b466bc31d3bb4be6c.yml +openapi_spec_hash: 966e424d276460ac50dc3d974a3773d6 config_hash: 625db64572b7ee0ee1dd00546e53fc5f diff --git a/lib/knockapi/models/message.rb b/lib/knockapi/models/message.rb index b8ff0cf6..72cf18be 100644 --- a/lib/knockapi/models/message.rb +++ b/lib/knockapi/models/message.rb @@ -122,6 +122,13 @@ class Message < Knockapi::Internal::Type::BaseModel # @return [Time, nil] optional :read_at, Time, nil?: true + # @!attribute recipient_snapshot + # Recipient contact information captured at email send time. Null for non-email + # channels. + # + # @return [Knockapi::Models::Message::RecipientSnapshot, nil] + optional :recipient_snapshot, -> { Knockapi::Message::RecipientSnapshot }, nil?: true + # @!attribute scheduled_at # Timestamp when the message was scheduled to be sent. # @@ -149,7 +156,7 @@ class Message < Knockapi::Internal::Type::BaseModel # @return [String, nil] optional :workflow, String, nil?: true - # @!method initialize(id:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, channel: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil) + # @!method initialize(id:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, channel: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, recipient_snapshot: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil) # Some parameter documentations has been truncated, see # {Knockapi::Models::Message} for more details. # @@ -192,6 +199,8 @@ class Message < Knockapi::Internal::Type::BaseModel # # @param read_at [Time, nil] Timestamp when the message was read. # + # @param recipient_snapshot [Knockapi::Models::Message::RecipientSnapshot, nil] Recipient contact information captured at email send time. Null for non-email ch + # # @param scheduled_at [Time, nil] Timestamp when the message was scheduled to be sent. # # @param seen_at [Time, nil] Timestamp when the message was seen. @@ -401,6 +410,29 @@ module Type # @return [Array] end end + + # @see Knockapi::Models::Message#recipient_snapshot + class RecipientSnapshot < Knockapi::Internal::Type::BaseModel + # @!attribute email + # The email address the message was delivered to + # + # @return [String, nil] + optional :email, String + + # @!attribute name + # The recipient name at send time + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!method initialize(email: nil, name: nil) + # Recipient contact information captured at email send time. Null for non-email + # channels. + # + # @param email [String] The email address the message was delivered to + # + # @param name [String, nil] The recipient name at send time + end end end end diff --git a/lib/knockapi/models/message_event.rb b/lib/knockapi/models/message_event.rb index 8df97396..3b63b1a6 100644 --- a/lib/knockapi/models/message_event.rb +++ b/lib/knockapi/models/message_event.rb @@ -69,19 +69,19 @@ module Type MESSAGE_READ = :"message.read" MESSAGE_SENT = :"message.sent" MESSAGE_SEEN = :"message.seen" - MESSAGE_ARCHIVED = :"message.archived" + MESSAGE_CREATED = :"message.created" MESSAGE_QUEUED = :"message.queued" MESSAGE_DELIVERED = :"message.delivered" - MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_BOUNCED = :"message.bounced" MESSAGE_UNDELIVERED = :"message.undelivered" + MESSAGE_NOT_SENT = :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED = :"message.delivery_attempted" + MESSAGE_ARCHIVED = :"message.archived" MESSAGE_LINK_CLICKED = :"message.link_clicked" MESSAGE_INTERACTED = :"message.interacted" - MESSAGE_UNARCHIVED = :"message.unarchived" MESSAGE_UNSEEN = :"message.unseen" MESSAGE_UNREAD = :"message.unread" - MESSAGE_CREATED = :"message.created" + MESSAGE_UNARCHIVED = :"message.unarchived" # @!method self.values # @return [Array] diff --git a/rbi/knockapi/models/message.rbi b/rbi/knockapi/models/message.rbi index 7702b312..22404362 100644 --- a/rbi/knockapi/models/message.rbi +++ b/rbi/knockapi/models/message.rbi @@ -108,6 +108,19 @@ module Knockapi sig { returns(T.nilable(Time)) } attr_accessor :read_at + # Recipient contact information captured at email send time. Null for non-email + # channels. + sig { returns(T.nilable(Knockapi::Message::RecipientSnapshot)) } + attr_reader :recipient_snapshot + + sig do + params( + recipient_snapshot: + T.nilable(Knockapi::Message::RecipientSnapshot::OrHash) + ).void + end + attr_writer :recipient_snapshot + # Timestamp when the message was scheduled to be sent. sig { returns(T.nilable(Time)) } attr_accessor :scheduled_at @@ -158,6 +171,8 @@ module Knockapi link_clicked_at: T.nilable(Time), metadata: T.nilable(T::Hash[Symbol, T.anything]), read_at: T.nilable(Time), + recipient_snapshot: + T.nilable(Knockapi::Message::RecipientSnapshot::OrHash), scheduled_at: T.nilable(Time), seen_at: T.nilable(Time), tenant: T.nilable(String), @@ -208,6 +223,9 @@ module Knockapi metadata: nil, # Timestamp when the message was read. read_at: nil, + # Recipient contact information captured at email send time. Null for non-email + # channels. + recipient_snapshot: nil, # Timestamp when the message was scheduled to be sent. scheduled_at: nil, # Timestamp when the message was seen. @@ -242,6 +260,7 @@ module Knockapi link_clicked_at: T.nilable(Time), metadata: T.nilable(T::Hash[Symbol, T.anything]), read_at: T.nilable(Time), + recipient_snapshot: T.nilable(Knockapi::Message::RecipientSnapshot), scheduled_at: T.nilable(Time), seen_at: T.nilable(Time), tenant: T.nilable(String), @@ -534,6 +553,46 @@ module Knockapi end end end + + class RecipientSnapshot < Knockapi::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Knockapi::Message::RecipientSnapshot, + Knockapi::Internal::AnyHash + ) + end + + # The email address the message was delivered to + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The recipient name at send time + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Recipient contact information captured at email send time. Null for non-email + # channels. + sig do + params(email: String, name: T.nilable(String)).returns( + T.attached_class + ) + end + def self.new( + # The email address the message was delivered to + email: nil, + # The recipient name at send time + name: nil + ) + end + + sig { override.returns({ email: String, name: T.nilable(String) }) } + def to_hash + end + end end end end diff --git a/rbi/knockapi/models/message_event.rbi b/rbi/knockapi/models/message_event.rbi index c0eb0d54..e1f3b47e 100644 --- a/rbi/knockapi/models/message_event.rbi +++ b/rbi/knockapi/models/message_event.rbi @@ -95,8 +95,8 @@ module Knockapi T.let(:"message.sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_SEEN = T.let(:"message.seen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_ARCHIVED = - T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_CREATED = + T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_QUEUED = T.let(:"message.queued", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERED = @@ -104,8 +104,6 @@ module Knockapi :"message.delivered", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_NOT_SENT = - T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_BOUNCED = T.let(:"message.bounced", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNDELIVERED = @@ -113,11 +111,15 @@ module Knockapi :"message.undelivered", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_NOT_SENT = + T.let(:"message.not_sent", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_DELIVERY_ATTEMPTED = T.let( :"message.delivery_attempted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_ARCHIVED = + T.let(:"message.archived", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_LINK_CLICKED = T.let( :"message.link_clicked", @@ -128,17 +130,15 @@ module Knockapi :"message.interacted", Knockapi::MessageEvent::Type::TaggedSymbol ) + MESSAGE_UNSEEN = + T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) + MESSAGE_UNREAD = + T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) MESSAGE_UNARCHIVED = T.let( :"message.unarchived", Knockapi::MessageEvent::Type::TaggedSymbol ) - MESSAGE_UNSEEN = - T.let(:"message.unseen", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_UNREAD = - T.let(:"message.unread", Knockapi::MessageEvent::Type::TaggedSymbol) - MESSAGE_CREATED = - T.let(:"message.created", Knockapi::MessageEvent::Type::TaggedSymbol) sig do override.returns(T::Array[Knockapi::MessageEvent::Type::TaggedSymbol]) diff --git a/sig/knockapi/models/message.rbs b/sig/knockapi/models/message.rbs index 286c2885..6dc71d2d 100644 --- a/sig/knockapi/models/message.rbs +++ b/sig/knockapi/models/message.rbs @@ -20,6 +20,7 @@ module Knockapi link_clicked_at: Time?, metadata: ::Hash[Symbol, top]?, read_at: Time?, + recipient_snapshot: Knockapi::Message::RecipientSnapshot?, scheduled_at: Time?, seen_at: Time?, tenant: String?, @@ -69,6 +70,8 @@ module Knockapi attr_accessor read_at: Time? + attr_accessor recipient_snapshot: Knockapi::Message::RecipientSnapshot? + attr_accessor scheduled_at: Time? attr_accessor seen_at: Time? @@ -96,6 +99,7 @@ module Knockapi ?link_clicked_at: Time?, ?metadata: ::Hash[Symbol, top]?, ?read_at: Time?, + ?recipient_snapshot: Knockapi::Message::RecipientSnapshot?, ?scheduled_at: Time?, ?seen_at: Time?, ?tenant: String?, @@ -121,6 +125,7 @@ module Knockapi link_clicked_at: Time?, metadata: ::Hash[Symbol, top]?, read_at: Time?, + recipient_snapshot: Knockapi::Message::RecipientSnapshot?, scheduled_at: Time?, seen_at: Time?, tenant: String?, @@ -304,6 +309,20 @@ module Knockapi def self?.values: -> ::Array[Knockapi::Models::Message::Channel::type_] end end + + type recipient_snapshot = { email: String, name: String? } + + class RecipientSnapshot < Knockapi::Internal::Type::BaseModel + attr_reader email: String? + + def email=: (String) -> String + + attr_accessor name: String? + + def initialize: (?email: String, ?name: String?) -> void + + def to_hash: -> { email: String, name: String? } + end end end end diff --git a/sig/knockapi/models/message_event.rbs b/sig/knockapi/models/message_event.rbs index 3c8c64a5..19ef4787 100644 --- a/sig/knockapi/models/message_event.rbs +++ b/sig/knockapi/models/message_event.rbs @@ -45,19 +45,19 @@ module Knockapi :"message.read" | :"message.sent" | :"message.seen" - | :"message.archived" + | :"message.created" | :"message.queued" | :"message.delivered" - | :"message.not_sent" | :"message.bounced" | :"message.undelivered" + | :"message.not_sent" | :"message.delivery_attempted" + | :"message.archived" | :"message.link_clicked" | :"message.interacted" - | :"message.unarchived" | :"message.unseen" | :"message.unread" - | :"message.created" + | :"message.unarchived" module Type extend Knockapi::Internal::Type::Enum @@ -65,19 +65,19 @@ module Knockapi MESSAGE_READ: :"message.read" MESSAGE_SENT: :"message.sent" MESSAGE_SEEN: :"message.seen" - MESSAGE_ARCHIVED: :"message.archived" + MESSAGE_CREATED: :"message.created" MESSAGE_QUEUED: :"message.queued" MESSAGE_DELIVERED: :"message.delivered" - MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_BOUNCED: :"message.bounced" MESSAGE_UNDELIVERED: :"message.undelivered" + MESSAGE_NOT_SENT: :"message.not_sent" MESSAGE_DELIVERY_ATTEMPTED: :"message.delivery_attempted" + MESSAGE_ARCHIVED: :"message.archived" MESSAGE_LINK_CLICKED: :"message.link_clicked" MESSAGE_INTERACTED: :"message.interacted" - MESSAGE_UNARCHIVED: :"message.unarchived" MESSAGE_UNSEEN: :"message.unseen" MESSAGE_UNREAD: :"message.unread" - MESSAGE_CREATED: :"message.created" + MESSAGE_UNARCHIVED: :"message.unarchived" def self?.values: -> ::Array[Knockapi::Models::MessageEvent::type_] end diff --git a/test/knockapi/resources/messages_test.rb b/test/knockapi/resources/messages_test.rb index 4aa46866..e3ae5178 100644 --- a/test/knockapi/resources/messages_test.rb +++ b/test/knockapi/resources/messages_test.rb @@ -37,6 +37,7 @@ def test_list link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -72,6 +73,7 @@ def test_archive link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -107,6 +109,7 @@ def test_get link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -239,6 +242,7 @@ def test_mark_as_interacted link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -274,6 +278,7 @@ def test_mark_as_read link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -309,6 +314,7 @@ def test_mark_as_seen link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -344,6 +350,7 @@ def test_mark_as_unread link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -379,6 +386,7 @@ def test_mark_as_unseen link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, @@ -414,6 +422,7 @@ def test_unarchive link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, diff --git a/test/knockapi/resources/objects_test.rb b/test/knockapi/resources/objects_test.rb index da6524f5..221d1775 100644 --- a/test/knockapi/resources/objects_test.rb +++ b/test/knockapi/resources/objects_test.rb @@ -143,6 +143,7 @@ def test_list_messages link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, diff --git a/test/knockapi/resources/users_test.rb b/test/knockapi/resources/users_test.rb index 44bd2037..1cc09dce 100644 --- a/test/knockapi/resources/users_test.rb +++ b/test/knockapi/resources/users_test.rb @@ -154,6 +154,7 @@ def test_list_messages link_clicked_at: Time | nil, metadata: ^(Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]) | nil, read_at: Time | nil, + recipient_snapshot: Knockapi::Message::RecipientSnapshot | nil, scheduled_at: Time | nil, seen_at: Time | nil, tenant: String | nil, From 6be39e17e3f591d7da6d5318ee3542fb596123ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 15:52:10 +0000 Subject: [PATCH 41/41] release: 1.36.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/knockapi/version.rb | 2 +- 5 files changed, 47 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 44959ac4..f29e96b8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.35.0" + ".": "1.36.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 962cfa00..88e6af41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # Changelog +## 1.36.0 (2026-06-05) + +Full Changelog: [v1.35.0...v1.36.0](https://github.com/knocklabs/knock-ruby/compare/v1.35.0...v1.36.0) + +### Features + +* **api:** added new unset preferences methods ([9b272e8](https://github.com/knocklabs/knock-ruby/commit/9b272e8ced5eb194a57d79ba442fba9539a0c0ef)) +* **api:** api update ([692eda9](https://github.com/knocklabs/knock-ruby/commit/692eda92f04365b34921069ea4ceee12996dc562)) +* **api:** api update ([3c57fe3](https://github.com/knocklabs/knock-ruby/commit/3c57fe3e021d0c7ce2670d03d4666205458397da)) +* **api:** api update ([235f220](https://github.com/knocklabs/knock-ruby/commit/235f220522da41f5ec8f589858879e1885d8be67)) +* **api:** api update ([5c3a9c1](https://github.com/knocklabs/knock-ruby/commit/5c3a9c12f02fb3acbe8263f07dc7fb5d2134fc98)) +* **api:** api update ([e119cef](https://github.com/knocklabs/knock-ruby/commit/e119cef6b64fbeb3eda95e1a9418cdc5d058cd35)) +* **api:** api update ([e2d7908](https://github.com/knocklabs/knock-ruby/commit/e2d7908ccc094c06989d5f78c620ea8b6bdff6f0)) +* **api:** api update ([e697644](https://github.com/knocklabs/knock-ruby/commit/e697644fade546fea5be556f0f51024f8959228e)) +* **api:** api update ([cf13a4e](https://github.com/knocklabs/knock-ruby/commit/cf13a4eac94e30e2bd0256af75cb9547057890aa)) +* **api:** api update ([27e68a8](https://github.com/knocklabs/knock-ruby/commit/27e68a833d6045919ff9b61ee416cd65078c2aa3)) +* **api:** api update ([2d54bf7](https://github.com/knocklabs/knock-ruby/commit/2d54bf7fb14986bfcbe5a4f2cc4a797e65c8e670)) +* **api:** api update ([76bdadc](https://github.com/knocklabs/knock-ruby/commit/76bdadc2b8b10eecfbe70ed14a8f6c040e27374e)) +* **api:** api update ([373e78b](https://github.com/knocklabs/knock-ruby/commit/373e78b7f24449c77d98c0d05c897fdeb05641aa)) +* **api:** api update ([14c7bc7](https://github.com/knocklabs/knock-ruby/commit/14c7bc73e1677dc239ac48035ee0b034709750ae)) +* **api:** api update ([bd57879](https://github.com/knocklabs/knock-ruby/commit/bd578791c347de8b63caf60ba6340f19ac3a6a48)) +* **api:** api update ([da22d6e](https://github.com/knocklabs/knock-ruby/commit/da22d6e5573c3f093d081edcb6881ac23fcf9173)) +* **api:** api update ([628d4cc](https://github.com/knocklabs/knock-ruby/commit/628d4cc040ba05590a453be6824ea9329792f394)) +* **api:** api update ([f710ae2](https://github.com/knocklabs/knock-ruby/commit/f710ae264c9e1acdcf36b41b93e49cd7a8ebaf12)) +* **KNO-12791:** Add workflow recipient run APIs ([1e34f54](https://github.com/knocklabs/knock-ruby/commit/1e34f54ffff850939a1effd58cb9711b442d7a93)) +* support setting headers via env ([ad75b97](https://github.com/knocklabs/knock-ruby/commit/ad75b97225fd6634d7850dde00d5035e64d168a2)) + + +### Bug Fixes + +* align path encoding with RFC 3986 section 3.3 ([3e2268d](https://github.com/knocklabs/knock-ruby/commit/3e2268d3e0547fa66ad253e35c86da963cc36215)) +* **client:** elide content type header on requests without body ([4e8b8cf](https://github.com/knocklabs/knock-ruby/commit/4e8b8cfd2dbdd693a880d960df5e48baa29fce2b)) +* multipart encoding for file arrays ([0715076](https://github.com/knocklabs/knock-ruby/commit/0715076b3cb219501a9bedd7a449f4cedef2babb)) +* variable name typo ([cde1131](https://github.com/knocklabs/knock-ruby/commit/cde113151eb2879204409723971653616876fdee)) + + +### Chores + +* **internal:** more robust bootstrap script ([1023475](https://github.com/knocklabs/knock-ruby/commit/1023475aa6b6f5c04dae72aaf7ad397aa769e033)) +* **tests:** bump steady to v0.20.1 ([6eb6756](https://github.com/knocklabs/knock-ruby/commit/6eb6756ef89a7b99a3825bd5ab899bf2f0b030e2)) +* **tests:** bump steady to v0.20.2 ([4206b20](https://github.com/knocklabs/knock-ruby/commit/4206b20a8cd60362598da173185bbd236e659eff)) +* **tests:** bump steady to v0.22.1 ([5b37b24](https://github.com/knocklabs/knock-ruby/commit/5b37b2467d9d996161d02d5df3bbdf703f51bad7)) + ## 1.35.0 (2026-03-27) Full Changelog: [v1.34.0...v1.35.0](https://github.com/knocklabs/knock-ruby/compare/v1.34.0...v1.35.0) diff --git a/Gemfile.lock b/Gemfile.lock index 160fe40a..07907897 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - knockapi (1.35.0) + knockapi (1.36.0) cgi connection_pool diff --git a/README.md b/README.md index 8eed89b1..fcc79b32 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "knockapi", "~> 1.35.0" +gem "knockapi", "~> 1.36.0" ``` diff --git a/lib/knockapi/version.rb b/lib/knockapi/version.rb index 97ce31a3..5a13de61 100644 --- a/lib/knockapi/version.rb +++ b/lib/knockapi/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Knockapi - VERSION = "1.35.0" + VERSION = "1.36.0" end