Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
timeout-minutes: 10
name: lint
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@v4
Expand All @@ -33,6 +34,7 @@ jobs:
timeout-minutes: 10
name: test
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@v4
- name: Set up Ruby
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.9.0"
".": "1.10.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 89
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-fa68e7353b6d2eb51af35279f2f591a7d6168c5ade69c3cf40b5aae119ebcce1.yml
openapi_spec_hash: f9315c4f1d89624aa2447499dbfe734c
config_hash: b4c547c1d4c8cd0834bc793ddf5388ee
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-592610bb4a05ea45115eba7544acd8efbab327749d0f78bd83e164aa305dc0a7.yml
openapi_spec_hash: 6a65b9127625d9479ba6bff2ba3f8d37
config_hash: c835f0912492c3f1189f78f876c7c90c
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.10.0 (2025-07-15)

Full Changelog: [v1.9.0...v1.10.0](https://github.com/knocklabs/knock-ruby/compare/v1.9.0...v1.10.0)

### Features

* **api:** api update ([d8ce1f1](https://github.com/knocklabs/knock-ruby/commit/d8ce1f14fbfd984d72a8eaa81a060659f46eb9b7))
* **api:** api update ([b3ed2ae](https://github.com/knocklabs/knock-ruby/commit/b3ed2ae46f54a0e046a8bcef0492c6ae6ee2555a))


### Chores

* **ci:** only run for pushes and fork pull requests ([854d6f0](https://github.com/knocklabs/knock-ruby/commit/854d6f0a527695decdb8e0e4a0093bc3d94eff9f))
* **internal:** allow streams to also be unwrapped on a per-row basis ([f77e1d6](https://github.com/knocklabs/knock-ruby/commit/f77e1d62802fc88dcb62764834ac1c71005d1f87))

## 1.9.0 (2025-06-27)

Full Changelog: [v1.8.1...v1.9.0](https://github.com/knocklabs/knock-ruby/compare/v1.8.1...v1.9.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
knockapi (1.9.0)
knockapi (1.10.0)
connection_pool

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

```ruby
gem "knockapi", "~> 1.9.0"
gem "knockapi", "~> 1.10.0"
```

<!-- x-release-please-end -->
Expand Down
12 changes: 10 additions & 2 deletions lib/knockapi/internal/transport/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def request(req)
self.class.validate!(req)
model = req.fetch(:model) { Knockapi::Internal::Type::Unknown }
opts = req[:options].to_h
unwrap = req[:unwrap]
Knockapi::RequestOptions.validate!(opts)
request = build_request(req.except(:options), opts)
url = request.fetch(:url)
Expand All @@ -487,11 +488,18 @@ def request(req)
decoded = Knockapi::Internal::Util.decode_content(response, stream: stream)
case req
in {stream: Class => st}
st.new(model: model, url: url, status: status, response: response, stream: decoded)
st.new(
model: model,
url: url,
status: status,
response: response,
unwrap: unwrap,
stream: decoded
)
in {page: Class => page}
page.new(client: self, req: req, headers: response, page_data: decoded)
else
unwrapped = Knockapi::Internal::Util.dig(decoded, req[:unwrap])
unwrapped = Knockapi::Internal::Util.dig(decoded, unwrap)
Knockapi::Internal::Type::Converter.coerce(model, unwrapped)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class QueryOptions < Knockapi::Internal::Type::BaseModel
# @!attribute types
# Mix and match channel types by providing a comma-separated list of any
# combination of public_channel, private_channel, mpim, im. Defaults to
# `"public_channel,private_channel"`.
# `"public_channel,private_channel"`. If the user's Slack ID is unavailable, this
# option is ignored and only public channels are returned.
#
# @return [String, nil]
optional :types, String
Expand Down
10 changes: 5 additions & 5 deletions lib/knockapi/models/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class Schedule < Knockapi::Internal::Type::BaseModel
optional :actor, union: -> { Knockapi::Recipient }, nil?: true

# @!attribute data
# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
#
# @return [Hash{Symbol=>Object}, nil]
optional :data, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true
Expand Down Expand Up @@ -103,7 +103,7 @@ class Schedule < Knockapi::Internal::Type::BaseModel
#
# @param actor [Knockapi::Models::User, Knockapi::Models::Object, nil] A recipient of a notification, which is either a user or an object.
#
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim
#
# @param last_occurrence_at [Time, nil] The last occurrence of the schedule.
#
Expand Down
10 changes: 5 additions & 5 deletions lib/knockapi/models/schedule_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class ScheduleCreateParams < Knockapi::Internal::Type::BaseModel
optional :actor, union: -> { Knockapi::RecipientRequest }, nil?: true

# @!attribute data
# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
#
# @return [Hash{Symbol=>Object}, nil]
optional :data, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true
Expand Down Expand Up @@ -70,7 +70,7 @@ class ScheduleCreateParams < 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 data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim
#
# @param ending_at [Time, nil] The ending date and time for the schedule.
#
Expand Down
10 changes: 5 additions & 5 deletions lib/knockapi/models/schedule_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class ScheduleUpdateParams < Knockapi::Internal::Type::BaseModel
optional :actor, union: -> { Knockapi::RecipientReference }, nil?: true

# @!attribute data
# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
#
# @return [Hash{Symbol=>Object}, nil]
optional :data, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true
Expand Down Expand Up @@ -61,7 +61,7 @@ class ScheduleUpdateParams < Knockapi::Internal::Type::BaseModel
#
# @param actor [String, Knockapi::Models::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer
#
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim
#
# @param ending_at [Time, nil] The ending date and time for the schedule.
#
Expand Down
10 changes: 5 additions & 5 deletions lib/knockapi/models/schedules/bulk_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class Schedule < Knockapi::Internal::Type::BaseModel
optional :actor, union: -> { Knockapi::RecipientRequest }, nil?: true

# @!attribute data
# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
#
# @return [Hash{Symbol=>Object}, nil]
optional :data, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true
Expand Down Expand Up @@ -86,7 +86,7 @@ class Schedule < 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 data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim
#
# @param ending_at [Time, nil] The ending date and time for the schedule.
#
Expand Down
10 changes: 5 additions & 5 deletions lib/knockapi/models/workflow_trigger_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class WorkflowTriggerParams < Knockapi::Internal::Type::BaseModel
optional :cancellation_key, String, nil?: true

# @!attribute data
# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
#
# @return [Hash{Symbol=>Object}, nil]
optional :data, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown], nil?: true
Expand All @@ -57,7 +57,7 @@ class WorkflowTriggerParams < Knockapi::Internal::Type::BaseModel
#
# @param cancellation_key [String, nil] An optional key that is used to reference a specific workflow trigger request wh
#
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim
#
# @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline.
#
Expand Down
4 changes: 2 additions & 2 deletions lib/knockapi/resources/schedules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Schedules
#
# @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 data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim
#
# @param ending_at [Time, nil] The ending date and time for the schedule.
#
Expand Down Expand Up @@ -64,7 +64,7 @@ def create(params)
#
# @param actor [String, Knockapi::Models::RecipientReference::ObjectReference, nil] A reference to a recipient, either a user identifier (string) or an object refer
#
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim
#
# @param ending_at [Time, nil] The ending date and time for the schedule.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/knockapi/resources/workflows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def cancel(key, params)
#
# @param cancellation_key [String, nil] An optional key that is used to reference a specific workflow trigger request wh
#
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 1024 byt
# @param data [Hash{Symbol=>Object}, nil] An optional map of data to pass into the workflow execution. There is a 10MB lim
#
# @param tenant [String, Knockapi::Models::TenantRequest, nil] An request to set a tenant inline.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/knockapi/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Knockapi
VERSION = "1.9.0"
VERSION = "1.10.0"
end
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ module Knockapi

# Mix and match channel types by providing a comma-separated list of any
# combination of public_channel, private_channel, mpim, im. Defaults to
# `"public_channel,private_channel"`.
# `"public_channel,private_channel"`. If the user's Slack ID is unavailable, this
# option is ignored and only public channels are returned.
sig { returns(T.nilable(String)) }
attr_reader :types

Expand Down Expand Up @@ -137,7 +138,8 @@ module Knockapi
team_id: nil,
# Mix and match channel types by providing a comma-separated list of any
# combination of public_channel, private_channel, mpim, im. Defaults to
# `"public_channel,private_channel"`.
# `"public_channel,private_channel"`. If the user's Slack ID is unavailable, this
# option is ignored and only public channels are returned.
types: nil
)
end
Expand Down
16 changes: 8 additions & 8 deletions rbi/knockapi/models/schedule.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ module Knockapi
sig { returns(T.nilable(Knockapi::Recipient::Variants)) }
attr_accessor :actor

# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
attr_accessor :data

Expand Down Expand Up @@ -97,10 +97,10 @@ module Knockapi
_typename: nil,
# A recipient of a notification, which is either a user or an object.
actor: nil,
# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
data: nil,
# The last occurrence of the schedule.
last_occurrence_at: nil,
Expand Down
16 changes: 8 additions & 8 deletions rbi/knockapi/models/schedule_create_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ module Knockapi
end
attr_accessor :actor

# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
attr_accessor :data

Expand Down Expand Up @@ -109,10 +109,10 @@ 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 map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
data: nil,
# The ending date and time for the schedule.
ending_at: nil,
Expand Down
16 changes: 8 additions & 8 deletions rbi/knockapi/models/schedule_update_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ module Knockapi
end
attr_accessor :actor

# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
attr_accessor :data

Expand Down Expand Up @@ -78,10 +78,10 @@ module Knockapi
# A reference to a recipient, either a user identifier (string) or an object
# reference (ID, collection).
actor: nil,
# An optional map of data to pass into the workflow execution. There is a 1024
# byte limit on the size of any single string value (with the exception of
# [email attachments](/integrations/email/attachments)), and a 10MB limit on the
# size of the full `data` payload.
# 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
# greater than 1024 bytes in length will be
# [truncated](/developer-tools/api-logs#log-truncation) in your logs.
data: nil,
# The ending date and time for the schedule.
ending_at: nil,
Expand Down
Loading