Skip to content
Open
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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,44 @@ on:
- 'stl-preview-base/**'

jobs:
build:
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/courier-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/courier-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork)
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
- run: |-
bundle install

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/courier-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Build and upload gem artifacts
if: |-
github.repository == 'stainless-sdks/courier-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
PACKAGE_NAME: courier
run: ./scripts/utils/upload-artifact.sh
lint:
timeout-minutes: 10
name: lint
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 @@
{
".": "4.7.1"
".": "4.8.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: 81
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-3fc1c86b4a83a16393aaf17d1fb3ac6098d30dd057ba872973b57285a7a3f0d0.yml
openapi_spec_hash: 02a545d217b13399f311e99561f9de1d
config_hash: 0789c3cddc625bb9712b3bded274ab6c
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-44c2e612f5d40e03f56712a4e123a193e6ea03cc64a91d0c34ee094563dafa1c.yml
openapi_spec_hash: 40bf6b3f7992d55f1bd543f32564ea86
config_hash: b1f6d0f43161b66d201043fcbe5c5695
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 4.8.0 (2026-03-07)

Full Changelog: [v4.7.1...v4.8.0](https://github.com/trycourier/courier-ruby/compare/v4.7.1...v4.8.0)

### Features

* **api:** add provider_key/device/tracking to token params, remove body_token ([acb3031](https://github.com/trycourier/courier-ruby/commit/acb30313188a385e2ad39be4f4040e4e5836106d))
* **api:** remove brand field from ElementalContent model ([519fcc0](https://github.com/trycourier/courier-ruby/commit/519fcc0a2f35a1fd61e64362b5a2e7b2d8225232))


### Chores

* **ci:** add build step ([d07ae3d](https://github.com/trycourier/courier-ruby/commit/d07ae3dc073f38ac30af1311f1d70153e441bf51))
* **ci:** skip uploading artifacts on stainless-internal branches ([d4c0636](https://github.com/trycourier/courier-ruby/commit/d4c06361e5ef4e7c0a3a1660215d63fe845694c5))
* **internal:** codegen related update ([3a0f51e](https://github.com/trycourier/courier-ruby/commit/3a0f51e6a03c33097f1307ac7974a3c5ca72ac90))
* **internal:** codegen related update ([1cce4a8](https://github.com/trycourier/courier-ruby/commit/1cce4a8be23782aae7fb9185b8ac2efd06516842))
* **internal:** remove mock server code ([a81351a](https://github.com/trycourier/courier-ruby/commit/a81351a2fde27b8a785a79436394a991e9048d97))
* update mock server docs ([62d69fc](https://github.com/trycourier/courier-ruby/commit/62d69fc657babf8ff535e150d74a2283ddb64459))


### Documentation

* add AUTO-GENERATED-OVERVIEW markers for README sync ([#75](https://github.com/trycourier/courier-ruby/issues/75)) ([ab86102](https://github.com/trycourier/courier-ruby/commit/ab86102437d2af03dc45beae7262371c70b6847f))
* sync README from mintlify-docs (2026-02-20 18:11 UTC) ([#76](https://github.com/trycourier/courier-ruby/issues/76)) ([cc67458](https://github.com/trycourier/courier-ruby/commit/cc6745816e152b890b84caaf666178bdbd9d3192))

## 4.7.1 (2026-02-07)

Full Changelog: [v4.7.0...v4.7.1](https://github.com/trycourier/courier-ruby/compare/v4.7.0...v4.7.1)
Expand Down
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ $ bundle exec rake

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```bash
$ npx prism mock path/to/your/openapi.yml
```

```bash
$ bundle exec rake test
```
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:
trycourier (4.7.1)
trycourier (4.8.0)
cgi
connection_pool

Expand Down
31 changes: 31 additions & 0 deletions lib/courier/internal/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,37 @@ def writable_enum(&blk)
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}

class << self
# @api private
#
# @param query [Hash{Symbol=>Object}]
#
# @return [Hash{Symbol=>Object}]
def encode_query_params(query)
out = {}
query.each { write_query_param_element!(out, _1, _2) }
out
end

# @api private
#
# @param collection [Hash{Symbol=>Object}]
# @param key [String]
# @param element [Object]
#
# @return [nil]
private def write_query_param_element!(collection, key, element)
case element
in Hash
element.each do |name, value|
write_query_param_element!(collection, "#{key}[#{name}]", value)
end
in Array
collection[key] = element.map(&:to_s).join(",")
else
collection[key] = element.to_s
end
end

# @api private
#
# @param y [Enumerator::Yielder]
Expand Down
8 changes: 7 additions & 1 deletion lib/courier/models/audience_delete_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class AudienceDeleteParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute audience_id
#
# @return [String]
required :audience_id, String

# @!method initialize(audience_id:, request_options: {})
# @param audience_id [String]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
9 changes: 8 additions & 1 deletion lib/courier/models/audience_list_members_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ class AudienceListMembersParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!attribute audience_id
#
# @return [String]
required :audience_id, String

# @!attribute cursor
# A unique identifier that allows for fetching the next set of members
#
# @return [String, nil]
optional :cursor, String, nil?: true

# @!method initialize(cursor: nil, request_options: {})
# @!method initialize(audience_id:, cursor: nil, request_options: {})
# @param audience_id [String]
#
# @param cursor [String, nil] A unique identifier that allows for fetching the next set of members
#
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
Expand Down
8 changes: 7 additions & 1 deletion lib/courier/models/audience_retrieve_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class AudienceRetrieveParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute audience_id
#
# @return [String]
required :audience_id, String

# @!method initialize(audience_id:, request_options: {})
# @param audience_id [String]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
9 changes: 8 additions & 1 deletion lib/courier/models/audience_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class AudienceUpdateParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!attribute audience_id
#
# @return [String]
required :audience_id, String

# @!attribute description
# A description of the audience
#
Expand All @@ -31,10 +36,12 @@ class AudienceUpdateParams < Courier::Internal::Type::BaseModel
# @return [Symbol, Courier::Models::AudienceUpdateParams::Operator, nil]
optional :operator, enum: -> { Courier::AudienceUpdateParams::Operator }, nil?: true

# @!method initialize(description: nil, filter: nil, name: nil, operator: nil, request_options: {})
# @!method initialize(audience_id:, description: nil, filter: nil, name: nil, operator: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {Courier::Models::AudienceUpdateParams} for more details.
#
# @param audience_id [String]
#
# @param description [String, nil] A description of the audience
#
# @param filter [Courier::Models::AudienceFilterConfig, nil] Filter configuration for audience membership containing an array of filter rules
Expand Down
8 changes: 7 additions & 1 deletion lib/courier/models/audit_event_retrieve_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class AuditEventRetrieveParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute audit_event_id
#
# @return [String]
required :audit_event_id, String

# @!method initialize(audit_event_id:, request_options: {})
# @param audit_event_id [String]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ class InvokeInvokeByTemplateParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!attribute template_id
#
# @return [String]
required :template_id, String

# @!attribute recipient
#
# @return [String, nil]
Expand All @@ -33,7 +38,8 @@ class InvokeInvokeByTemplateParams < Courier::Internal::Type::BaseModel
# @return [String, nil]
optional :template, String, nil?: true

# @!method initialize(recipient:, brand: nil, data: nil, profile: nil, template: nil, request_options: {})
# @!method initialize(template_id:, recipient:, brand: nil, data: nil, profile: nil, template: nil, request_options: {})
# @param template_id [String]
# @param recipient [String, nil]
# @param brand [String, nil]
# @param data [Hash{Symbol=>Object}, nil]
Expand Down
8 changes: 7 additions & 1 deletion lib/courier/models/brand_delete_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class BrandDeleteParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute brand_id
#
# @return [String]
required :brand_id, String

# @!method initialize(brand_id:, request_options: {})
# @param brand_id [String]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
8 changes: 7 additions & 1 deletion lib/courier/models/brand_retrieve_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class BrandRetrieveParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute brand_id
#
# @return [String]
required :brand_id, String

# @!method initialize(brand_id:, request_options: {})
# @param brand_id [String]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
9 changes: 8 additions & 1 deletion lib/courier/models/brand_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class BrandUpdateParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!attribute brand_id
#
# @return [String]
required :brand_id, String

# @!attribute name
# The name of the brand.
#
Expand All @@ -23,7 +28,9 @@ class BrandUpdateParams < Courier::Internal::Type::BaseModel
# @return [Courier::Models::BrandSnippets, nil]
optional :snippets, -> { Courier::BrandSnippets }, nil?: true

# @!method initialize(name:, settings: nil, snippets: nil, request_options: {})
# @!method initialize(brand_id:, name:, settings: nil, snippets: nil, request_options: {})
# @param brand_id [String]
#
# @param name [String] The name of the brand.
#
# @param settings [Courier::Models::BrandSettings, nil]
Expand Down
8 changes: 7 additions & 1 deletion lib/courier/models/bulk_add_users_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ class BulkAddUsersParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!attribute job_id
#
# @return [String]
required :job_id, String

# @!attribute users
#
# @return [Array<Courier::Models::InboundBulkMessageUser>]
required :users, -> { Courier::Internal::Type::ArrayOf[Courier::InboundBulkMessageUser] }

# @!method initialize(users:, request_options: {})
# @!method initialize(job_id:, users:, request_options: {})
# @param job_id [String]
# @param users [Array<Courier::Models::InboundBulkMessageUser>]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
Expand Down
9 changes: 8 additions & 1 deletion lib/courier/models/bulk_list_users_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,24 @@ class BulkListUsersParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!attribute job_id
#
# @return [String]
required :job_id, String

# @!attribute cursor
# A unique identifier that allows for fetching the next set of users added to the
# bulk job
#
# @return [String, nil]
optional :cursor, String, nil?: true

# @!method initialize(cursor: nil, request_options: {})
# @!method initialize(job_id:, cursor: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {Courier::Models::BulkListUsersParams} for more details.
#
# @param job_id [String]
#
# @param cursor [String, nil] A unique identifier that allows for fetching the next set of users added to the
#
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
Expand Down
8 changes: 7 additions & 1 deletion lib/courier/models/bulk_retrieve_job_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class BulkRetrieveJobParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute job_id
#
# @return [String]
required :job_id, String

# @!method initialize(job_id:, request_options: {})
# @param job_id [String]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
8 changes: 7 additions & 1 deletion lib/courier/models/bulk_run_job_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class BulkRunJobParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

# @!method initialize(request_options: {})
# @!attribute job_id
#
# @return [String]
required :job_id, String

# @!method initialize(job_id:, request_options: {})
# @param job_id [String]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
Loading