trycourier 4.25.0 → 4.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6479592040b865063a1f1d9bec5fbea1650cdd5025a335068c39feefb4ae6fd9
4
- data.tar.gz: da1ecb2bc7246befec1f12882a02c59d95e6e28b51f3348fbd75286c416cc1c1
3
+ metadata.gz: c82d3665f14afda7c4e656a802da5d7e949a73570d969e0ba4963ebca052cafb
4
+ data.tar.gz: 4e20b157ddb87e3f8bb4699f4010dac082c231550fcd546ecea09c514aae6baf
5
5
  SHA512:
6
- metadata.gz: a2550c508b661f15771d19f7c3d090641f439bd10031a5cbfa9a4323e09c42ce866d58575b53333255adeeb41fe462a7108c5505dc7123b434596c62bd331412
7
- data.tar.gz: 4e3d97189c87af8c1165756d3a7a9fe69d583b0d4c3a9e223bdcefadd782e7f371aeff7c5e9548908547e85e107e34aaf11e21bd3a0c29cd5e79ab99cbddcc1b
6
+ metadata.gz: 41b277139739fa601401ff3b160af7f1d501782edc24c1efb0029d8042ec3fdab8580237b1ebae867322fd78f61977787248aab8c112c14341055f1576d6ed94
7
+ data.tar.gz: 32c6c9dcabd41b05a7773e30c869a16013a695503a76ba75b921447c2ba166c560f806c20842de315b6c188febf6b9a716ffc7a8dd60e857b9a65b471877976c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.26.0 (2026-08-10)
4
+
5
+ Full Changelog: [v4.25.0...v4.26.0](https://github.com/trycourier/courier-ruby/compare/v4.25.0...v4.26.0)
6
+
7
+ ### Features
8
+
9
+ * Merge pull request [#185](https://github.com/trycourier/courier-ruby/issues/185) from trycourier/geraldosilva/c-19821-notifications-alias-v2 ([c9a2bd8](https://github.com/trycourier/courier-ruby/commit/c9a2bd82de3f3cca82a5de6430e09e93490b709e))
10
+
3
11
  ## 4.25.0 (2026-08-04)
4
12
 
5
13
  Full Changelog: [v4.24.0...v4.25.0](https://github.com/trycourier/courier-ruby/compare/v4.24.0...v4.25.0)
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # A template's send-time alias as returned by a read, omitted entirely when it has
6
+ # none. Usually a single string; an array for a template that resolves from
7
+ # several aliases, which writes through this API can no longer produce — only
8
+ # templates predating that restriction, or aliases attached outside this API, hold
9
+ # more than one.
10
+ module NotificationTemplateAlias
11
+ extend Courier::Internal::Type::Union
12
+
13
+ variant String
14
+
15
+ variant -> { Courier::Models::NotificationTemplateAlias::StringArray }
16
+
17
+ # @!method self.variants
18
+ # @return [Array(String, Array<String>)]
19
+
20
+ # @type [Courier::Internal::Type::Converter]
21
+ StringArray = Courier::Internal::Type::ArrayOf[String]
22
+ end
23
+ end
24
+ end
@@ -4,11 +4,11 @@ module Courier
4
4
  module Models
5
5
  class NotificationTemplateCreateRequest < Courier::Internal::Type::BaseModel
6
6
  # @!attribute notification
7
- # Core template fields used in POST and PUT request bodies (nested under a
8
- # `notification` key) and returned at the top level in responses.
7
+ # Template fields accepted in POST and PUT request bodies, nested under a
8
+ # `notification` key.
9
9
  #
10
- # @return [Courier::Models::NotificationTemplatePayload]
11
- required :notification, -> { Courier::NotificationTemplatePayload }
10
+ # @return [Courier::Models::NotificationTemplateWritePayload]
11
+ required :notification, -> { Courier::NotificationTemplateWritePayload }
12
12
 
13
13
  # @!attribute state
14
14
  # Template state after creation. Case-insensitive input, normalized to uppercase
@@ -23,7 +23,7 @@ module Courier
23
23
  #
24
24
  # Request body for creating a notification template.
25
25
  #
26
- # @param notification [Courier::Models::NotificationTemplatePayload] Core template fields used in POST and PUT request bodies (nested under a `notifi
26
+ # @param notification [Courier::Models::NotificationTemplateWritePayload] Template fields accepted in POST and PUT request bodies, nested under a `notific
27
27
  #
28
28
  # @param state [Symbol, Courier::Models::NotificationTemplateCreateRequest::State] Template state after creation. Case-insensitive input, normalized to uppercase i
29
29
 
@@ -28,6 +28,16 @@ module Courier
28
28
  # @return [Symbol, Courier::Models::NotificationTemplateResponse::State]
29
29
  required :state, enum: -> { Courier::NotificationTemplateResponse::State }
30
30
 
31
+ # @!attribute alias_
32
+ # A template's send-time alias as returned by a read, omitted entirely when it has
33
+ # none. Usually a single string; an array for a template that resolves from
34
+ # several aliases, which writes through this API can no longer produce — only
35
+ # templates predating that restriction, or aliases attached outside this API, hold
36
+ # more than one.
37
+ #
38
+ # @return [String, Array<String>, nil]
39
+ optional :alias_, union: -> { Courier::NotificationTemplateAlias }, api_name: :alias
40
+
31
41
  # @!attribute updated
32
42
  # Epoch milliseconds of last update.
33
43
  #
@@ -40,7 +50,10 @@ module Courier
40
50
  # @return [String, nil]
41
51
  optional :updater, String
42
52
 
43
- # @!method initialize(id:, created:, creator:, state:, updated: nil, updater: nil)
53
+ # @!method initialize(id:, created:, creator:, state:, alias_: nil, updated: nil, updater: nil)
54
+ # Some parameter documentations has been truncated, see
55
+ # {Courier::Models::NotificationTemplateResponse} for more details.
56
+ #
44
57
  # Response for GET /notifications/{id}, POST /notifications, and PUT
45
58
  # /notifications/{id}. Returns all template fields at the top level.
46
59
  #
@@ -52,6 +65,8 @@ module Courier
52
65
  #
53
66
  # @param state [Symbol, Courier::Models::NotificationTemplateResponse::State] The template state. Always uppercase.
54
67
  #
68
+ # @param alias_ [String, Array<String>] A template's send-time alias as returned by a read, omitted entirely when it has
69
+ #
55
70
  # @param updated [Integer] Epoch milliseconds of last update.
56
71
  #
57
72
  # @param updater [String] User ID of the last updater.
@@ -4,11 +4,11 @@ module Courier
4
4
  module Models
5
5
  class NotificationTemplateUpdateRequest < Courier::Internal::Type::BaseModel
6
6
  # @!attribute notification
7
- # Core template fields used in POST and PUT request bodies (nested under a
8
- # `notification` key) and returned at the top level in responses.
7
+ # Template fields accepted in POST and PUT request bodies, nested under a
8
+ # `notification` key.
9
9
  #
10
- # @return [Courier::Models::NotificationTemplatePayload]
11
- required :notification, -> { Courier::NotificationTemplatePayload }
10
+ # @return [Courier::Models::NotificationTemplateWritePayload]
11
+ required :notification, -> { Courier::NotificationTemplateWritePayload }
12
12
 
13
13
  # @!attribute state
14
14
  # Template state after update. Case-insensitive input, normalized to uppercase in
@@ -22,9 +22,10 @@ module Courier
22
22
  # {Courier::Models::NotificationTemplateUpdateRequest} for more details.
23
23
  #
24
24
  # Request body for replacing a notification template. Same shape as create. All
25
- # fields required (PUT = full replacement).
25
+ # fields required (PUT = full replacement), except `alias`, whose omission means
26
+ # "leave the existing aliases alone".
26
27
  #
27
- # @param notification [Courier::Models::NotificationTemplatePayload] Core template fields used in POST and PUT request bodies (nested under a `notifi
28
+ # @param notification [Courier::Models::NotificationTemplateWritePayload] Template fields accepted in POST and PUT request bodies, nested under a `notific
28
29
  #
29
30
  # @param state [Symbol, Courier::Models::NotificationTemplateUpdateRequest::State] Template state after update. Case-insensitive input, normalized to uppercase in
30
31
 
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateWritePayload < Courier::Models::NotificationTemplatePayload
6
+ # @!attribute alias_
7
+ # Send-time alias for this template — the value you pass as `event` to POST /send.
8
+ # Writes accept a single alias only. Optional, with three distinct meanings. Omit
9
+ # it to leave any existing aliases untouched. Send a string to make this the
10
+ # template's only alias — a template that already resolved from several aliases
11
+ # keeps just this one and the rest are detached. Send null to remove every alias
12
+ # from the template. An alias may not be claimed by another template — doing so
13
+ # returns 409 — and may not begin with "tenant/".
14
+ #
15
+ # @return [String, nil]
16
+ optional :alias_, String, api_name: :alias, nil?: true
17
+
18
+ # @!method initialize(alias_: nil)
19
+ # Some parameter documentations has been truncated, see
20
+ # {Courier::Models::NotificationTemplateWritePayload} for more details.
21
+ #
22
+ # Template fields accepted in POST and PUT request bodies, nested under a
23
+ # `notification` key.
24
+ #
25
+ # @param alias_ [String, nil] Send-time alias for this template — the value you pass as `event` to POST /send.
26
+ end
27
+ end
28
+ end
@@ -406,6 +406,8 @@ module Courier
406
406
 
407
407
  Notifications = Courier::Models::Notifications
408
408
 
409
+ NotificationTemplateAlias = Courier::Models::NotificationTemplateAlias
410
+
409
411
  NotificationTemplateCreateRequest = Courier::Models::NotificationTemplateCreateRequest
410
412
 
411
413
  NotificationTemplatePayload = Courier::Models::NotificationTemplatePayload
@@ -422,6 +424,8 @@ module Courier
422
424
 
423
425
  NotificationTemplateVersionListResponse = Courier::Models::NotificationTemplateVersionListResponse
424
426
 
427
+ NotificationTemplateWritePayload = Courier::Models::NotificationTemplateWritePayload
428
+
425
429
  Pagerduty = Courier::Models::Pagerduty
426
430
 
427
431
  PagerdutyRecipient = Courier::Models::PagerdutyRecipient
@@ -18,7 +18,7 @@ module Courier
18
18
  #
19
19
  # @overload create(notification:, state: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
20
20
  #
21
- # @param notification [Courier::Models::NotificationTemplatePayload] Body param: Core template fields used in POST and PUT request bodies (nested und
21
+ # @param notification [Courier::Models::NotificationTemplateWritePayload] Body param: Template fields accepted in POST and PUT request bodies, nested unde
22
22
  #
23
23
  # @param state [Symbol, Courier::Models::NotificationTemplateCreateRequest::State] Body param: Template state after creation. Case-insensitive input, normalized to
24
24
  #
@@ -321,7 +321,7 @@ module Courier
321
321
  #
322
322
  # @param id [String] Template ID (nt\_ prefix).
323
323
  #
324
- # @param notification [Courier::Models::NotificationTemplatePayload] Core template fields used in POST and PUT request bodies (nested under a `notifi
324
+ # @param notification [Courier::Models::NotificationTemplateWritePayload] Template fields accepted in POST and PUT request bodies, nested under a `notific
325
325
  #
326
326
  # @param state [Symbol, Courier::Models::NotificationTemplateUpdateRequest::State] Template state after update. Case-insensitive input, normalized to uppercase in
327
327
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.25.0"
4
+ VERSION = "4.26.0"
5
5
  end
data/lib/courier.rb CHANGED
@@ -287,10 +287,12 @@ require_relative "courier/models/notifications/check_list_params"
287
287
  require_relative "courier/models/notifications/check_list_response"
288
288
  require_relative "courier/models/notifications/check_update_params"
289
289
  require_relative "courier/models/notifications/check_update_response"
290
+ require_relative "courier/models/notification_template_alias"
290
291
  require_relative "courier/models/notification_template_response"
291
292
  require_relative "courier/models/notification_template_state"
292
293
  require_relative "courier/models/notification_template_summary"
293
294
  require_relative "courier/models/notification_template_version_list_response"
295
+ require_relative "courier/models/notification_template_write_payload"
294
296
  require_relative "courier/models/pagerduty"
295
297
  require_relative "courier/models/pagerduty_recipient"
296
298
  require_relative "courier/models/paging"
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ # A template's send-time alias as returned by a read, omitted entirely when it has
6
+ # none. Usually a single string; an array for a template that resolves from
7
+ # several aliases, which writes through this API can no longer produce — only
8
+ # templates predating that restriction, or aliases attached outside this API, hold
9
+ # more than one.
10
+ module NotificationTemplateAlias
11
+ extend Courier::Internal::Type::Union
12
+
13
+ Variants = T.type_alias { T.any(String, T::Array[String]) }
14
+
15
+ sig do
16
+ override.returns(T::Array[Courier::NotificationTemplateAlias::Variants])
17
+ end
18
+ def self.variants
19
+ end
20
+
21
+ StringArray =
22
+ T.let(
23
+ Courier::Internal::Type::ArrayOf[String],
24
+ Courier::Internal::Type::Converter
25
+ )
26
+ end
27
+ end
28
+ end
@@ -11,13 +11,15 @@ module Courier
11
11
  )
12
12
  end
13
13
 
14
- # Core template fields used in POST and PUT request bodies (nested under a
15
- # `notification` key) and returned at the top level in responses.
16
- sig { returns(Courier::NotificationTemplatePayload) }
14
+ # Template fields accepted in POST and PUT request bodies, nested under a
15
+ # `notification` key.
16
+ sig { returns(Courier::NotificationTemplateWritePayload) }
17
17
  attr_reader :notification
18
18
 
19
19
  sig do
20
- params(notification: Courier::NotificationTemplatePayload::OrHash).void
20
+ params(
21
+ notification: Courier::NotificationTemplateWritePayload::OrHash
22
+ ).void
21
23
  end
22
24
  attr_writer :notification
23
25
 
@@ -40,13 +42,13 @@ module Courier
40
42
  # Request body for creating a notification template.
41
43
  sig do
42
44
  params(
43
- notification: Courier::NotificationTemplatePayload::OrHash,
45
+ notification: Courier::NotificationTemplateWritePayload::OrHash,
44
46
  state: Courier::NotificationTemplateCreateRequest::State::OrSymbol
45
47
  ).returns(T.attached_class)
46
48
  end
47
49
  def self.new(
48
- # Core template fields used in POST and PUT request bodies (nested under a
49
- # `notification` key) and returned at the top level in responses.
50
+ # Template fields accepted in POST and PUT request bodies, nested under a
51
+ # `notification` key.
50
52
  notification:,
51
53
  # Template state after creation. Case-insensitive input, normalized to uppercase
52
54
  # in the response. Defaults to "DRAFT".
@@ -57,7 +59,7 @@ module Courier
57
59
  sig do
58
60
  override.returns(
59
61
  {
60
- notification: Courier::NotificationTemplatePayload,
62
+ notification: Courier::NotificationTemplateWritePayload,
61
63
  state: Courier::NotificationTemplateCreateRequest::State::OrSymbol
62
64
  }
63
65
  )
@@ -29,6 +29,17 @@ module Courier
29
29
  end
30
30
  attr_accessor :state
31
31
 
32
+ # A template's send-time alias as returned by a read, omitted entirely when it has
33
+ # none. Usually a single string; an array for a template that resolves from
34
+ # several aliases, which writes through this API can no longer produce — only
35
+ # templates predating that restriction, or aliases attached outside this API, hold
36
+ # more than one.
37
+ sig { returns(T.nilable(Courier::NotificationTemplateAlias::Variants)) }
38
+ attr_reader :alias_
39
+
40
+ sig { params(alias_: Courier::NotificationTemplateAlias::Variants).void }
41
+ attr_writer :alias_
42
+
32
43
  # Epoch milliseconds of last update.
33
44
  sig { returns(T.nilable(Integer)) }
34
45
  attr_reader :updated
@@ -51,6 +62,7 @@ module Courier
51
62
  created: Integer,
52
63
  creator: String,
53
64
  state: Courier::NotificationTemplateResponse::State::OrSymbol,
65
+ alias_: Courier::NotificationTemplateAlias::Variants,
54
66
  updated: Integer,
55
67
  updater: String
56
68
  ).returns(T.attached_class)
@@ -64,6 +76,12 @@ module Courier
64
76
  creator:,
65
77
  # The template state. Always uppercase.
66
78
  state:,
79
+ # A template's send-time alias as returned by a read, omitted entirely when it has
80
+ # none. Usually a single string; an array for a template that resolves from
81
+ # several aliases, which writes through this API can no longer produce — only
82
+ # templates predating that restriction, or aliases attached outside this API, hold
83
+ # more than one.
84
+ alias_: nil,
67
85
  # Epoch milliseconds of last update.
68
86
  updated: nil,
69
87
  # User ID of the last updater.
@@ -78,6 +96,7 @@ module Courier
78
96
  created: Integer,
79
97
  creator: String,
80
98
  state: Courier::NotificationTemplateResponse::State::TaggedSymbol,
99
+ alias_: Courier::NotificationTemplateAlias::Variants,
81
100
  updated: Integer,
82
101
  updater: String
83
102
  }
@@ -11,13 +11,15 @@ module Courier
11
11
  )
12
12
  end
13
13
 
14
- # Core template fields used in POST and PUT request bodies (nested under a
15
- # `notification` key) and returned at the top level in responses.
16
- sig { returns(Courier::NotificationTemplatePayload) }
14
+ # Template fields accepted in POST and PUT request bodies, nested under a
15
+ # `notification` key.
16
+ sig { returns(Courier::NotificationTemplateWritePayload) }
17
17
  attr_reader :notification
18
18
 
19
19
  sig do
20
- params(notification: Courier::NotificationTemplatePayload::OrHash).void
20
+ params(
21
+ notification: Courier::NotificationTemplateWritePayload::OrHash
22
+ ).void
21
23
  end
22
24
  attr_writer :notification
23
25
 
@@ -38,16 +40,17 @@ module Courier
38
40
  attr_writer :state
39
41
 
40
42
  # Request body for replacing a notification template. Same shape as create. All
41
- # fields required (PUT = full replacement).
43
+ # fields required (PUT = full replacement), except `alias`, whose omission means
44
+ # "leave the existing aliases alone".
42
45
  sig do
43
46
  params(
44
- notification: Courier::NotificationTemplatePayload::OrHash,
47
+ notification: Courier::NotificationTemplateWritePayload::OrHash,
45
48
  state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol
46
49
  ).returns(T.attached_class)
47
50
  end
48
51
  def self.new(
49
- # Core template fields used in POST and PUT request bodies (nested under a
50
- # `notification` key) and returned at the top level in responses.
52
+ # Template fields accepted in POST and PUT request bodies, nested under a
53
+ # `notification` key.
51
54
  notification:,
52
55
  # Template state after update. Case-insensitive input, normalized to uppercase in
53
56
  # the response. Defaults to "DRAFT".
@@ -58,7 +61,7 @@ module Courier
58
61
  sig do
59
62
  override.returns(
60
63
  {
61
- notification: Courier::NotificationTemplatePayload,
64
+ notification: Courier::NotificationTemplateWritePayload,
62
65
  state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol
63
66
  }
64
67
  )
@@ -0,0 +1,44 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateWritePayload < Courier::Models::NotificationTemplatePayload
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::NotificationTemplateWritePayload,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # Send-time alias for this template — the value you pass as `event` to POST /send.
15
+ # Writes accept a single alias only. Optional, with three distinct meanings. Omit
16
+ # it to leave any existing aliases untouched. Send a string to make this the
17
+ # template's only alias — a template that already resolved from several aliases
18
+ # keeps just this one and the rest are detached. Send null to remove every alias
19
+ # from the template. An alias may not be claimed by another template — doing so
20
+ # returns 409 — and may not begin with "tenant/".
21
+ sig { returns(T.nilable(String)) }
22
+ attr_accessor :alias_
23
+
24
+ # Template fields accepted in POST and PUT request bodies, nested under a
25
+ # `notification` key.
26
+ sig { params(alias_: T.nilable(String)).returns(T.attached_class) }
27
+ def self.new(
28
+ # Send-time alias for this template — the value you pass as `event` to POST /send.
29
+ # Writes accept a single alias only. Optional, with three distinct meanings. Omit
30
+ # it to leave any existing aliases untouched. Send a string to make this the
31
+ # template's only alias — a template that already resolved from several aliases
32
+ # keeps just this one and the rest are detached. Send null to remove every alias
33
+ # from the template. An alias may not be claimed by another template — doing so
34
+ # returns 409 — and may not begin with "tenant/".
35
+ alias_: nil
36
+ )
37
+ end
38
+
39
+ sig { override.returns({ alias_: T.nilable(String) }) }
40
+ def to_hash
41
+ end
42
+ end
43
+ end
44
+ end
@@ -378,6 +378,8 @@ module Courier
378
378
 
379
379
  Notifications = Courier::Models::Notifications
380
380
 
381
+ NotificationTemplateAlias = Courier::Models::NotificationTemplateAlias
382
+
381
383
  NotificationTemplateCreateRequest =
382
384
  Courier::Models::NotificationTemplateCreateRequest
383
385
 
@@ -398,6 +400,9 @@ module Courier
398
400
  NotificationTemplateVersionListResponse =
399
401
  Courier::Models::NotificationTemplateVersionListResponse
400
402
 
403
+ NotificationTemplateWritePayload =
404
+ Courier::Models::NotificationTemplateWritePayload
405
+
401
406
  Pagerduty = Courier::Models::Pagerduty
402
407
 
403
408
  PagerdutyRecipient = Courier::Models::PagerdutyRecipient
@@ -14,7 +14,7 @@ module Courier
14
14
  # Templates are created in draft state by default.
15
15
  sig do
16
16
  params(
17
- notification: Courier::NotificationTemplatePayload::OrHash,
17
+ notification: Courier::NotificationTemplateWritePayload::OrHash,
18
18
  state: Courier::NotificationTemplateCreateRequest::State::OrSymbol,
19
19
  idempotency_key: String,
20
20
  x_idempotency_expiration: String,
@@ -22,8 +22,8 @@ module Courier
22
22
  ).returns(Courier::NotificationTemplateResponse)
23
23
  end
24
24
  def create(
25
- # Body param: Core template fields used in POST and PUT request bodies (nested
26
- # under a `notification` key) and returned at the top level in responses.
25
+ # Body param: Template fields accepted in POST and PUT request bodies, nested
26
+ # under a `notification` key.
27
27
  notification:,
28
28
  # Body param: Template state after creation. Case-insensitive input, normalized to
29
29
  # uppercase in the response. Defaults to "DRAFT".
@@ -259,7 +259,7 @@ module Courier
259
259
  sig do
260
260
  params(
261
261
  id: String,
262
- notification: Courier::NotificationTemplatePayload::OrHash,
262
+ notification: Courier::NotificationTemplateWritePayload::OrHash,
263
263
  state: Courier::NotificationTemplateUpdateRequest::State::OrSymbol,
264
264
  request_options: Courier::RequestOptions::OrHash
265
265
  ).returns(Courier::NotificationTemplateResponse)
@@ -267,8 +267,8 @@ module Courier
267
267
  def replace(
268
268
  # Template ID (nt\_ prefix).
269
269
  id,
270
- # Core template fields used in POST and PUT request bodies (nested under a
271
- # `notification` key) and returned at the top level in responses.
270
+ # Template fields accepted in POST and PUT request bodies, nested under a
271
+ # `notification` key.
272
272
  notification:,
273
273
  # Template state after update. Case-insensitive input, normalized to uppercase in
274
274
  # the response. Defaults to "DRAFT".
@@ -0,0 +1,13 @@
1
+ module Courier
2
+ module Models
3
+ type notification_template_alias = String | ::Array[String]
4
+
5
+ module NotificationTemplateAlias
6
+ extend Courier::Internal::Type::Union
7
+
8
+ def self?.variants: -> ::Array[Courier::Models::notification_template_alias]
9
+
10
+ StringArray: Courier::Internal::Type::Converter
11
+ end
12
+ end
13
+ end
@@ -2,12 +2,12 @@ module Courier
2
2
  module Models
3
3
  type notification_template_create_request =
4
4
  {
5
- notification: Courier::NotificationTemplatePayload,
5
+ notification: Courier::NotificationTemplateWritePayload,
6
6
  state: Courier::Models::NotificationTemplateCreateRequest::state
7
7
  }
8
8
 
9
9
  class NotificationTemplateCreateRequest < Courier::Internal::Type::BaseModel
10
- attr_accessor notification: Courier::NotificationTemplatePayload
10
+ attr_accessor notification: Courier::NotificationTemplateWritePayload
11
11
 
12
12
  attr_reader state: Courier::Models::NotificationTemplateCreateRequest::state?
13
13
 
@@ -16,12 +16,12 @@ module Courier
16
16
  ) -> Courier::Models::NotificationTemplateCreateRequest::state
17
17
 
18
18
  def initialize: (
19
- notification: Courier::NotificationTemplatePayload,
19
+ notification: Courier::NotificationTemplateWritePayload,
20
20
  ?state: Courier::Models::NotificationTemplateCreateRequest::state
21
21
  ) -> void
22
22
 
23
23
  def to_hash: -> {
24
- notification: Courier::NotificationTemplatePayload,
24
+ notification: Courier::NotificationTemplateWritePayload,
25
25
  state: Courier::Models::NotificationTemplateCreateRequest::state
26
26
  }
27
27
 
@@ -6,6 +6,7 @@ module Courier
6
6
  created: Integer,
7
7
  creator: String,
8
8
  state: Courier::Models::NotificationTemplateResponse::state,
9
+ alias_: Courier::Models::notification_template_alias,
9
10
  updated: Integer,
10
11
  updater: String
11
12
  }
@@ -29,6 +30,12 @@ module Courier
29
30
  Courier::Models::NotificationTemplateResponse::state _
30
31
  ) -> Courier::Models::NotificationTemplateResponse::state
31
32
 
33
+ def alias_: -> Courier::Models::notification_template_alias?
34
+
35
+ def alias_=: (
36
+ Courier::Models::notification_template_alias _
37
+ ) -> Courier::Models::notification_template_alias
38
+
32
39
  def updated: -> Integer?
33
40
 
34
41
  def updated=: (Integer _) -> Integer
@@ -42,6 +49,7 @@ module Courier
42
49
  created: Integer,
43
50
  creator: String,
44
51
  state: Courier::Models::NotificationTemplateResponse::state,
52
+ ?alias_: Courier::Models::notification_template_alias,
45
53
  ?updated: Integer,
46
54
  ?updater: String
47
55
  ) -> void
@@ -51,6 +59,7 @@ module Courier
51
59
  created: Integer,
52
60
  creator: String,
53
61
  state: Courier::Models::NotificationTemplateResponse::state,
62
+ alias_: Courier::Models::notification_template_alias,
54
63
  updated: Integer,
55
64
  updater: String
56
65
  }
@@ -2,12 +2,12 @@ module Courier
2
2
  module Models
3
3
  type notification_template_update_request =
4
4
  {
5
- notification: Courier::NotificationTemplatePayload,
5
+ notification: Courier::NotificationTemplateWritePayload,
6
6
  state: Courier::Models::NotificationTemplateUpdateRequest::state
7
7
  }
8
8
 
9
9
  class NotificationTemplateUpdateRequest < Courier::Internal::Type::BaseModel
10
- attr_accessor notification: Courier::NotificationTemplatePayload
10
+ attr_accessor notification: Courier::NotificationTemplateWritePayload
11
11
 
12
12
  attr_reader state: Courier::Models::NotificationTemplateUpdateRequest::state?
13
13
 
@@ -16,12 +16,12 @@ module Courier
16
16
  ) -> Courier::Models::NotificationTemplateUpdateRequest::state
17
17
 
18
18
  def initialize: (
19
- notification: Courier::NotificationTemplatePayload,
19
+ notification: Courier::NotificationTemplateWritePayload,
20
20
  ?state: Courier::Models::NotificationTemplateUpdateRequest::state
21
21
  ) -> void
22
22
 
23
23
  def to_hash: -> {
24
- notification: Courier::NotificationTemplatePayload,
24
+ notification: Courier::NotificationTemplateWritePayload,
25
25
  state: Courier::Models::NotificationTemplateUpdateRequest::state
26
26
  }
27
27
 
@@ -0,0 +1,15 @@
1
+ module Courier
2
+ module Models
3
+ type notification_template_write_payload = { alias_: String? }
4
+
5
+ class NotificationTemplateWritePayload < Courier::Models::NotificationTemplatePayload
6
+ def alias_: -> String?
7
+
8
+ def alias_=: (String? _) -> String?
9
+
10
+ def initialize: (?alias_: String?) -> void
11
+
12
+ def to_hash: -> { alias_: String? }
13
+ end
14
+ end
15
+ end
@@ -363,6 +363,8 @@ module Courier
363
363
 
364
364
  module Notifications = Courier::Models::Notifications
365
365
 
366
+ module NotificationTemplateAlias = Courier::Models::NotificationTemplateAlias
367
+
366
368
  class NotificationTemplateCreateRequest = Courier::Models::NotificationTemplateCreateRequest
367
369
 
368
370
  class NotificationTemplatePayload = Courier::Models::NotificationTemplatePayload
@@ -379,6 +381,8 @@ module Courier
379
381
 
380
382
  class NotificationTemplateVersionListResponse = Courier::Models::NotificationTemplateVersionListResponse
381
383
 
384
+ class NotificationTemplateWritePayload = Courier::Models::NotificationTemplateWritePayload
385
+
382
386
  class Pagerduty = Courier::Models::Pagerduty
383
387
 
384
388
  class PagerdutyRecipient = Courier::Models::PagerdutyRecipient
@@ -4,7 +4,7 @@ module Courier
4
4
  attr_reader checks: Courier::Resources::Notifications::Checks
5
5
 
6
6
  def create: (
7
- notification: Courier::NotificationTemplatePayload,
7
+ notification: Courier::NotificationTemplateWritePayload,
8
8
  ?state: Courier::Models::NotificationTemplateCreateRequest::state,
9
9
  ?idempotency_key: String,
10
10
  ?x_idempotency_expiration: String,
@@ -76,7 +76,7 @@ module Courier
76
76
 
77
77
  def replace: (
78
78
  String id,
79
- notification: Courier::NotificationTemplatePayload,
79
+ notification: Courier::NotificationTemplateWritePayload,
80
80
  ?state: Courier::Models::NotificationTemplateUpdateRequest::state,
81
81
  ?request_options: Courier::request_opts
82
82
  ) -> Courier::NotificationTemplateResponse
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trycourier
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.25.0
4
+ version: 4.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courier
@@ -281,6 +281,7 @@ files:
281
281
  - lib/courier/models/notification_retrieve_content_params.rb
282
282
  - lib/courier/models/notification_retrieve_content_response.rb
283
283
  - lib/courier/models/notification_retrieve_params.rb
284
+ - lib/courier/models/notification_template_alias.rb
284
285
  - lib/courier/models/notification_template_create_request.rb
285
286
  - lib/courier/models/notification_template_payload.rb
286
287
  - lib/courier/models/notification_template_publish_request.rb
@@ -289,6 +290,7 @@ files:
289
290
  - lib/courier/models/notification_template_summary.rb
290
291
  - lib/courier/models/notification_template_update_request.rb
291
292
  - lib/courier/models/notification_template_version_list_response.rb
293
+ - lib/courier/models/notification_template_write_payload.rb
292
294
  - lib/courier/models/notifications/check_delete_params.rb
293
295
  - lib/courier/models/notifications/check_list_params.rb
294
296
  - lib/courier/models/notifications/check_list_response.rb
@@ -719,6 +721,7 @@ files:
719
721
  - rbi/courier/models/notification_retrieve_content_params.rbi
720
722
  - rbi/courier/models/notification_retrieve_content_response.rbi
721
723
  - rbi/courier/models/notification_retrieve_params.rbi
724
+ - rbi/courier/models/notification_template_alias.rbi
722
725
  - rbi/courier/models/notification_template_create_request.rbi
723
726
  - rbi/courier/models/notification_template_payload.rbi
724
727
  - rbi/courier/models/notification_template_publish_request.rbi
@@ -727,6 +730,7 @@ files:
727
730
  - rbi/courier/models/notification_template_summary.rbi
728
731
  - rbi/courier/models/notification_template_update_request.rbi
729
732
  - rbi/courier/models/notification_template_version_list_response.rbi
733
+ - rbi/courier/models/notification_template_write_payload.rbi
730
734
  - rbi/courier/models/notifications/check_delete_params.rbi
731
735
  - rbi/courier/models/notifications/check_list_params.rbi
732
736
  - rbi/courier/models/notifications/check_list_response.rbi
@@ -1156,6 +1160,7 @@ files:
1156
1160
  - sig/courier/models/notification_retrieve_content_params.rbs
1157
1161
  - sig/courier/models/notification_retrieve_content_response.rbs
1158
1162
  - sig/courier/models/notification_retrieve_params.rbs
1163
+ - sig/courier/models/notification_template_alias.rbs
1159
1164
  - sig/courier/models/notification_template_create_request.rbs
1160
1165
  - sig/courier/models/notification_template_payload.rbs
1161
1166
  - sig/courier/models/notification_template_publish_request.rbs
@@ -1164,6 +1169,7 @@ files:
1164
1169
  - sig/courier/models/notification_template_summary.rbs
1165
1170
  - sig/courier/models/notification_template_update_request.rbs
1166
1171
  - sig/courier/models/notification_template_version_list_response.rbs
1172
+ - sig/courier/models/notification_template_write_payload.rbs
1167
1173
  - sig/courier/models/notifications/check_delete_params.rbs
1168
1174
  - sig/courier/models/notifications/check_list_params.rbs
1169
1175
  - sig/courier/models/notifications/check_list_response.rbs