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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/courier-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/courier-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/courier-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
Expand All @@ -73,7 +73,7 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/courier-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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.19.2"
".": "4.20.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 138
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-11e1931d767cef402bbed5a965746d1933ae72db0f41881860593a0b1424fd80.yml
openapi_spec_hash: 9def941805f233f8761c4bdae88f6137
config_hash: 6c3a754258f0f77e9032a90a478ab76d
configured_endpoints: 139
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-b03f5346718dcd7b22f15893445ea593ab87535c90c540fc5a796c6ecd54d779.yml
openapi_spec_hash: 15677d3be4ecd33eab154080b4bc437f
config_hash: dcd58abf1e56b114bdce22336ca3d570
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 4.20.0 (2026-07-20)

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

### Features

* Document POST /notifications/{id}/duplicate [C-18607] ([#165](https://github.com/trycourier/courier-ruby/issues/165)) ([212644c](https://github.com/trycourier/courier-ruby/commit/212644cd49ac7b108944831e04289d2e9e073b7d))
* Merge pull request [#149](https://github.com/trycourier/courier-ruby/issues/149) from trycourier/geraldosilva/c-19201-notification-template-subscription-topic-id ([cd697fa](https://github.com/trycourier/courier-ruby/commit/cd697fa2d3b49db32db582dae1789ab03706ced5))
* Merge pull request [#168](https://github.com/trycourier/courier-ruby/issues/168) from trycourier/geraldosilva/c-19419-topic-id-notification-template-summary ([71d47f3](https://github.com/trycourier/courier-ruby/commit/71d47f336799157c0dfd99276951359d391a8a7d))
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([c5fe04e](https://github.com/trycourier/courier-ruby/commit/c5fe04ea6c0ed2c5ce38ca49738c293e44557688))

## 4.19.2 (2026-07-10)

Full Changelog: [v4.19.1...v4.19.2](https://github.com/trycourier/courier-ruby/compare/v4.19.1...v4.19.2)
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.19.2)
trycourier (4.20.0)
cgi
connection_pool

Expand Down
1 change: 1 addition & 0 deletions lib/courier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
require_relative "courier/models/notification_content_get_response"
require_relative "courier/models/notification_content_mutation_response"
require_relative "courier/models/notification_create_params"
require_relative "courier/models/notification_duplicate_params"
require_relative "courier/models/notification_get_content"
require_relative "courier/models/notification_list_params"
require_relative "courier/models/notification_list_response"
Expand Down
2 changes: 2 additions & 0 deletions lib/courier/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ module Courier

NotificationCreateParams = Courier::Models::NotificationCreateParams

NotificationDuplicateParams = Courier::Models::NotificationDuplicateParams

NotificationElementPutRequest = Courier::Models::NotificationElementPutRequest

NotificationGetContent = Courier::Models::NotificationGetContent
Expand Down
20 changes: 20 additions & 0 deletions lib/courier/models/notification_duplicate_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module Courier
module Models
# @see Courier::Resources::Notifications#duplicate
class NotificationDuplicateParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

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

# @!method initialize(id:, request_options: {})
# @param id [String]
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
end
end
end
23 changes: 22 additions & 1 deletion lib/courier/models/notification_template_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ class NotificationTemplateSummary < Courier::Internal::Type::BaseModel
# @return [Array<String>]
required :tags, Courier::Internal::Type::ArrayOf[String]

# @!attribute subscription_topic_id
# The linked subscription (preference) topic of the published version. Omitted
# when no topic is linked or the template has never been published.
#
# @return [String, nil]
optional :subscription_topic_id, String

# @!attribute topic_id
# Alias of subscription_topic_id, provided under the same name V1 list items use
# for the linked topic. Always carries the same value as subscription_topic_id.
#
# @return [String, nil]
optional :topic_id, String

# @!attribute updated
# Epoch milliseconds of last update.
#
Expand All @@ -47,7 +61,10 @@ class NotificationTemplateSummary < Courier::Internal::Type::BaseModel
# @return [String, nil]
optional :updater, String

# @!method initialize(id:, created:, creator:, name:, state:, tags:, updated: nil, updater: nil)
# @!method initialize(id:, created:, creator:, name:, state:, tags:, subscription_topic_id: nil, topic_id: nil, updated: nil, updater: nil)
# Some parameter documentations has been truncated, see
# {Courier::Models::NotificationTemplateSummary} for more details.
#
# V2 (CDS) template summary returned in list responses.
#
# @param id [String]
Expand All @@ -62,6 +79,10 @@ class NotificationTemplateSummary < Courier::Internal::Type::BaseModel
#
# @param tags [Array<String>]
#
# @param subscription_topic_id [String] The linked subscription (preference) topic of the published version. Omitted whe
#
# @param topic_id [String] Alias of subscription_topic_id, provided under the same name V1 list items use f
#
# @param updated [Integer] Epoch milliseconds of last update.
#
# @param updater [String] User ID of the last updater.
Expand Down
25 changes: 25 additions & 0 deletions lib/courier/resources/notifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,31 @@ def archive(id, params = {})
)
end

# Duplicate a notification template. Creates a standalone copy within the same
# workspace and environment, with " COPY" appended to the title. The copy clones
# the source draft's tags, brand, subscription topic, routing strategy, channels,
# and content, and is always created as a standalone template (it is not linked to
# any journey or broadcast, even if the source was). Templates that are scoped to
# a journey or a broadcast cannot be duplicated through this endpoint.
#
# @overload duplicate(id, request_options: {})
#
# @param id [String] Template ID (nt\_ prefix).
#
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [Courier::Models::NotificationTemplateResponse]
#
# @see Courier::Models::NotificationDuplicateParams
def duplicate(id, params = {})
@client.request(
method: :post,
path: ["notifications/%1$s/duplicate", id],
model: Courier::NotificationTemplateResponse,
options: params[:request_options]
)
end

# List versions of a notification template.
#
# @overload list_versions(id, cursor: nil, limit: nil, request_options: {})
Expand Down
2 changes: 1 addition & 1 deletion lib/courier/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Courier
VERSION = "4.19.2"
VERSION = "4.20.0"
end
2 changes: 2 additions & 0 deletions rbi/courier/models.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ module Courier

NotificationCreateParams = Courier::Models::NotificationCreateParams

NotificationDuplicateParams = Courier::Models::NotificationDuplicateParams

NotificationElementPutRequest = Courier::Models::NotificationElementPutRequest

NotificationGetContent = Courier::Models::NotificationGetContent
Expand Down
38 changes: 38 additions & 0 deletions rbi/courier/models/notification_duplicate_params.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# typed: strong

module Courier
module Models
class NotificationDuplicateParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

OrHash =
T.type_alias do
T.any(
Courier::NotificationDuplicateParams,
Courier::Internal::AnyHash
)
end

sig { returns(String) }
attr_accessor :id

sig do
params(
id: String,
request_options: Courier::RequestOptions::OrHash
).returns(T.attached_class)
end
def self.new(id:, request_options: {})
end

sig do
override.returns(
{ id: String, request_options: Courier::RequestOptions }
)
end
def to_hash
end
end
end
end
26 changes: 26 additions & 0 deletions rbi/courier/models/notification_template_summary.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ module Courier
sig { returns(T::Array[String]) }
attr_accessor :tags

# The linked subscription (preference) topic of the published version. Omitted
# when no topic is linked or the template has never been published.
sig { returns(T.nilable(String)) }
attr_reader :subscription_topic_id

sig { params(subscription_topic_id: String).void }
attr_writer :subscription_topic_id

# Alias of subscription_topic_id, provided under the same name V1 list items use
# for the linked topic. Always carries the same value as subscription_topic_id.
sig { returns(T.nilable(String)) }
attr_reader :topic_id

sig { params(topic_id: String).void }
attr_writer :topic_id

# Epoch milliseconds of last update.
sig { returns(T.nilable(Integer)) }
attr_reader :updated
Expand All @@ -54,6 +70,8 @@ module Courier
name: String,
state: Courier::NotificationTemplateSummary::State::OrSymbol,
tags: T::Array[String],
subscription_topic_id: String,
topic_id: String,
updated: Integer,
updater: String
).returns(T.attached_class)
Expand All @@ -67,6 +85,12 @@ module Courier
name:,
state:,
tags:,
# The linked subscription (preference) topic of the published version. Omitted
# when no topic is linked or the template has never been published.
subscription_topic_id: nil,
# Alias of subscription_topic_id, provided under the same name V1 list items use
# for the linked topic. Always carries the same value as subscription_topic_id.
topic_id: nil,
# Epoch milliseconds of last update.
updated: nil,
# User ID of the last updater.
Expand All @@ -83,6 +107,8 @@ module Courier
name: String,
state: Courier::NotificationTemplateSummary::State::TaggedSymbol,
tags: T::Array[String],
subscription_topic_id: String,
topic_id: String,
updated: Integer,
updater: String
}
Expand Down
19 changes: 19 additions & 0 deletions rbi/courier/resources/notifications.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@ module Courier
)
end

# Duplicate a notification template. Creates a standalone copy within the same
# workspace and environment, with " COPY" appended to the title. The copy clones
# the source draft's tags, brand, subscription topic, routing strategy, channels,
# and content, and is always created as a standalone template (it is not linked to
# any journey or broadcast, even if the source was). Templates that are scoped to
# a journey or a broadcast cannot be duplicated through this endpoint.
sig do
params(
id: String,
request_options: Courier::RequestOptions::OrHash
).returns(Courier::NotificationTemplateResponse)
end
def duplicate(
# Template ID (nt\_ prefix).
id,
request_options: {}
)
end

# List versions of a notification template.
sig do
params(
Expand Down
2 changes: 2 additions & 0 deletions sig/courier/models.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ module Courier

class NotificationCreateParams = Courier::Models::NotificationCreateParams

class NotificationDuplicateParams = Courier::Models::NotificationDuplicateParams

class NotificationElementPutRequest = Courier::Models::NotificationElementPutRequest

class NotificationGetContent = Courier::Models::NotificationGetContent
Expand Down
20 changes: 20 additions & 0 deletions sig/courier/models/notification_duplicate_params.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Courier
module Models
type notification_duplicate_params =
{ id: String } & Courier::Internal::Type::request_parameters

class NotificationDuplicateParams < Courier::Internal::Type::BaseModel
extend Courier::Internal::Type::RequestParameters::Converter
include Courier::Internal::Type::RequestParameters

attr_accessor id: String

def initialize: (
id: String,
?request_options: Courier::request_opts
) -> void

def to_hash: -> { id: String, request_options: Courier::RequestOptions }
end
end
end
14 changes: 14 additions & 0 deletions sig/courier/models/notification_template_summary.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module Courier
name: String,
state: Courier::Models::NotificationTemplateSummary::state,
tags: ::Array[String],
subscription_topic_id: String,
topic_id: String,
updated: Integer,
updater: String
}
Expand All @@ -25,6 +27,14 @@ module Courier

attr_accessor tags: ::Array[String]

attr_reader subscription_topic_id: String?

def subscription_topic_id=: (String) -> String

attr_reader topic_id: String?

def topic_id=: (String) -> String

attr_reader updated: Integer?

def updated=: (Integer) -> Integer
Expand All @@ -40,6 +50,8 @@ module Courier
name: String,
state: Courier::Models::NotificationTemplateSummary::state,
tags: ::Array[String],
?subscription_topic_id: String,
?topic_id: String,
?updated: Integer,
?updater: String
) -> void
Expand All @@ -51,6 +63,8 @@ module Courier
name: String,
state: Courier::Models::NotificationTemplateSummary::state,
tags: ::Array[String],
subscription_topic_id: String,
topic_id: String,
updated: Integer,
updater: String
}
Expand Down
Loading