Skip to content

Commit 969d867

Browse files
release: 1.33.0 (#71)
* fix(client): serialize query parameters properly * chore(docs): add missing descriptions * codegen metadata * feat(api): api update * feat(api): api update * chore(ci): add build step * release: 1.33.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 6ce2c45 commit 969d867

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+422
-37
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,40 @@ on:
1313
- 'stl-preview-base/**'
1414

1515
jobs:
16+
build:
17+
timeout-minutes: 10
18+
name: build
19+
permissions:
20+
contents: read
21+
id-token: write
22+
runs-on: ${{ github.repository == 'stainless-sdks/knock-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
23+
if: |-
24+
github.repository == 'stainless-sdks/knock-ruby' &&
25+
(github.event_name == 'push' || github.event.pull_request.head.repo.fork)
26+
steps:
27+
- uses: actions/checkout@v6
28+
- name: Set up Ruby
29+
uses: ruby/setup-ruby@v1
30+
with:
31+
bundler-cache: false
32+
- run: |-
33+
bundle install
34+
35+
- name: Get GitHub OIDC Token
36+
if: github.repository == 'stainless-sdks/knock-ruby'
37+
id: github-oidc
38+
uses: actions/github-script@v8
39+
with:
40+
script: core.setOutput('github_token', await core.getIDToken());
41+
42+
- name: Build and upload gem artifacts
43+
if: github.repository == 'stainless-sdks/knock-ruby'
44+
env:
45+
URL: https://pkg.stainless.com/s
46+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
47+
SHA: ${{ github.sha }}
48+
PACKAGE_NAME: knockapi
49+
run: ./scripts/utils/upload-artifact.sh
1650
lint:
1751
timeout-minutes: 10
1852
name: lint

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.32.1"
2+
".": "1.33.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 90
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-b0b2bad50557aa0fe95d42cd97c6b45e8c45f6f257950048545faafafc851a17.yml
3-
openapi_spec_hash: 4e26fcff8efa06e31f3b2bfc191a7006
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-eaaacf2abf99e5ee2fd681d70e02e9d0bbc7a0216d25cf4f10bae75c5fb59df5.yml
3+
openapi_spec_hash: 51a8f39a76a1bcd85d29a0949d6c353a
44
config_hash: 32503026a45db991d0d102f25af40a77

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## 1.33.0 (2026-03-03)
4+
5+
Full Changelog: [v1.32.1...v1.33.0](https://github.com/knocklabs/knock-ruby/compare/v1.32.1...v1.33.0)
6+
7+
### Features
8+
9+
* **api:** api update ([7ba6675](https://github.com/knocklabs/knock-ruby/commit/7ba667550ffe7a071924b835e6f7bbb735dc93ad))
10+
* **api:** api update ([9a5227f](https://github.com/knocklabs/knock-ruby/commit/9a5227feaac4df242717be5e3704e4e327783250))
11+
12+
13+
### Bug Fixes
14+
15+
* **client:** serialize query parameters properly ([0a76966](https://github.com/knocklabs/knock-ruby/commit/0a7696661973ba7e4f461be1bda646a3654a955a))
16+
17+
18+
### Chores
19+
20+
* **ci:** add build step ([979140d](https://github.com/knocklabs/knock-ruby/commit/979140db56dabc14ead8dd64cee25c12c38f8c40))
21+
* **docs:** add missing descriptions ([d1d2610](https://github.com/knocklabs/knock-ruby/commit/d1d26104b361735f37a9739d676e350d088f27b8))
22+
323
## 1.32.1 (2026-02-26)
424

525
Full Changelog: [v1.32.0...v1.32.1](https://github.com/knocklabs/knock-ruby/compare/v1.32.0...v1.32.1)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
knockapi (1.32.1)
14+
knockapi (1.33.0)
1515
cgi
1616
connection_pool
1717

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
1717
<!-- x-release-please-start-version -->
1818

1919
```ruby
20-
gem "knockapi", "~> 1.32.1"
20+
gem "knockapi", "~> 1.33.0"
2121
```
2222

2323
<!-- x-release-please-end -->

lib/knockapi/client.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,26 @@ class Client < Knockapi::Internal::Transport::BaseClient
2525
# @return [Knockapi::Resources::Recipients]
2626
attr_reader :recipients
2727

28+
# A user is an individual from your system, represented in Knock. They are most
29+
# commonly a recipient of a notification.
2830
# @return [Knockapi::Resources::Users]
2931
attr_reader :users
3032

33+
# An object represents a resource in your system that you want to map into Knock.
3134
# @return [Knockapi::Resources::Objects]
3235
attr_reader :objects
3336

37+
# A tenant represents a top-level entity from your system, like a company,
38+
# organization, account, or workspace.
3439
# @return [Knockapi::Resources::Tenants]
3540
attr_reader :tenants
3641

42+
# A bulk operation is a set of changes applied across zero or more records
43+
# triggered via a call to the Knock API and performed asynchronously.
3744
# @return [Knockapi::Resources::BulkOperations]
3845
attr_reader :bulk_operations
3946

47+
# A message sent to a single recipient on a channel.
4048
# @return [Knockapi::Resources::Messages]
4149
attr_reader :messages
4250

@@ -46,15 +54,20 @@ class Client < Knockapi::Internal::Transport::BaseClient
4654
# @return [Knockapi::Resources::Integrations]
4755
attr_reader :integrations
4856

57+
# A workflow is a structured set of steps that is triggered to produce
58+
# notifications sent over channels.
4959
# @return [Knockapi::Resources::Workflows]
5060
attr_reader :workflows
5161

62+
# A schedule is a per-recipient, timezone-aware configuration for when to invoke a
63+
# workflow.
5264
# @return [Knockapi::Resources::Schedules]
5365
attr_reader :schedules
5466

5567
# @return [Knockapi::Resources::Channels]
5668
attr_reader :channels
5769

70+
# An Audience is a segment of users.
5871
# @return [Knockapi::Resources::Audiences]
5972
attr_reader :audiences
6073

lib/knockapi/internal/util.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,37 @@ def writable_enum(&blk)
490490
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491491

492492
class << self
493+
# @api private
494+
#
495+
# @param query [Hash{Symbol=>Object}]
496+
#
497+
# @return [Hash{Symbol=>Object}]
498+
def encode_query_params(query)
499+
out = {}
500+
query.each { write_query_param_element!(out, _1, _2) }
501+
out
502+
end
503+
504+
# @api private
505+
#
506+
# @param collection [Hash{Symbol=>Object}]
507+
# @param key [String]
508+
# @param element [Object]
509+
#
510+
# @return [nil]
511+
private def write_query_param_element!(collection, key, element)
512+
case element
513+
in Hash
514+
element.each do |name, value|
515+
write_query_param_element!(collection, "#{key}[#{name}]", value)
516+
end
517+
in Array
518+
collection["#{key}[]"] = element.map(&:to_s)
519+
else
520+
collection[key] = element.to_s
521+
end
522+
end
523+
493524
# @api private
494525
#
495526
# @param y [Enumerator::Yielder]

lib/knockapi/resources/audiences.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
module Knockapi
44
module Resources
5+
# An Audience is a segment of users.
56
class Audiences
67
# Some parameter documentations has been truncated, see
78
# {Knockapi::Models::AudienceAddMembersParams} for more details.
@@ -22,12 +23,13 @@ class Audiences
2223
#
2324
# @see Knockapi::Models::AudienceAddMembersParams
2425
def add_members(key, params)
25-
parsed, options = Knockapi::AudienceAddMembersParams.dump_request(params)
2626
query_params = [:create_audience]
27+
parsed, options = Knockapi::AudienceAddMembersParams.dump_request(params)
28+
query = Knockapi::Internal::Util.encode_query_params(parsed.slice(*query_params))
2729
@client.request(
2830
method: :post,
2931
path: ["v1/audiences/%1$s/members", key],
30-
query: parsed.slice(*query_params),
32+
query: query,
3133
body: parsed.except(*query_params),
3234
model: NilClass,
3335
options: options

lib/knockapi/resources/bulk_operations.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module Knockapi
44
module Resources
5+
# A bulk operation is a set of changes applied across zero or more records
6+
# triggered via a call to the Knock API and performed asynchronously.
57
class BulkOperations
68
# Retrieves a bulk operation (if it exists) and displays the current state of it.
79
#

0 commit comments

Comments
 (0)