trycourier 4.23.0 → 4.24.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: 309ea61f0125b25e2bbafb9fc11e87220259bd66b2af26971ccb657a60f24b7c
4
- data.tar.gz: 529a8bf37ffa589a91591aff67e192fe4429263ab008d0f156cdf8aca00e7933
3
+ metadata.gz: 92699878aa77a9b29adce8e814e87b0c2369708e4eaff80d4cb39281d2a2fac3
4
+ data.tar.gz: 47907b5604d18e1f827398c5a24c21b80ed4b1fb4660d7c45c0cf3b15d5f3099
5
5
  SHA512:
6
- metadata.gz: cf7596a35ed847033067727fe8699e6a22fd57e927f560b8e81fb43618bc32ca5166d571782a478ba48d6b6bed7ef16878bcc842d78fb3804c81754f169d7e8e
7
- data.tar.gz: f807364e550ef500ae2a837aa7fcd657d6163dd6b71b67cd303c15e09d6f308240c08470cf69b15fcdfa96e91e818d19f65a0f2ad5518881e21b33c6fe2d96d0
6
+ metadata.gz: 42442c5a895cc9f1403944cef33abf7cb6673ba331d177291b3355239489c5f0fd991bd1201d3867a48e5b28fac32a43dc4de819157ad59639bc69c9a6ddc355
7
+ data.tar.gz: 3d90bfd02cfa4270aff7e8af390d966137481c6849be7c3062b171675311aa462f3a56272e879b79be6755e1989171ab3bd8e277650b028e5d5cc5a3036216e9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.24.0 (2026-08-03)
4
+
5
+ Full Changelog: [v4.23.0...v4.24.0](https://github.com/trycourier/courier-ruby/compare/v4.23.0...v4.24.0)
6
+
7
+ ### Features
8
+
9
+ * Merge pull request [#183](https://github.com/trycourier/courier-ruby/issues/183) from trycourier/dantran/c-19684-api-spec-document-messagecontexttenant_id-on-journey-send ([aedb9a8](https://github.com/trycourier/courier-ruby/commit/aedb9a8a3a7bc1ed7a5a63cf1c4330bc119a6155))
10
+ * spec: remove inbox message delete/restore endpoints for now (C-19268) ([#182](https://github.com/trycourier/courier-ruby/issues/182)) ([d98f978](https://github.com/trycourier/courier-ruby/commit/d98f9786a8396cb9258d4f798240dc53d57c7b98))
11
+ * spec: reorder API reference sections to match the Studio nav ([#180](https://github.com/trycourier/courier-ruby/issues/180)) ([fe03907](https://github.com/trycourier/courier-ruby/commit/fe03907ebe05595a7e9edf4ff7ecf11711c3156b))
12
+
3
13
  ## 4.23.0 (2026-07-29)
4
14
 
5
15
  Full Changelog: [v4.22.0...v4.23.0](https://github.com/trycourier/courier-ruby/compare/v4.22.0...v4.23.0)
@@ -53,6 +53,8 @@ module Courier
53
53
  # @return [Courier::Resources::Journeys]
54
54
  attr_reader :journeys
55
55
 
56
+ # Create a one-off send to a list or audience, author its content, then send it
57
+ # immediately or schedule it for later.
56
58
  # @return [Courier::Resources::Broadcasts]
57
59
  attr_reader :broadcasts
58
60
 
@@ -73,9 +75,6 @@ module Courier
73
75
  # @return [Courier::Resources::Lists]
74
76
  attr_reader :lists
75
77
 
76
- # @return [Courier::Resources::Inbox]
77
- attr_reader :inbox
78
-
79
78
  # Look up the messages Courier has accepted, inspect their delivery history and
80
79
  # rendered output, and cancel, resend, or archive them.
81
80
  # @return [Courier::Resources::Messages]
@@ -192,7 +191,6 @@ module Courier
192
191
  @digests = Courier::Resources::Digests.new(client: self)
193
192
  @inbound = Courier::Resources::Inbound.new(client: self)
194
193
  @lists = Courier::Resources::Lists.new(client: self)
195
- @inbox = Courier::Resources::Inbox.new(client: self)
196
194
  @messages = Courier::Resources::Messages.new(client: self)
197
195
  @requests = Courier::Resources::Requests.new(client: self)
198
196
  @notifications = Courier::Resources::Notifications.new(client: self)
@@ -14,7 +14,7 @@ module Courier
14
14
  # Trigger fired by a segment event (`identify`, `group`, or `track`).
15
15
  variant -> { Courier::JourneySegmentTriggerNode }
16
16
 
17
- # Send to the recipient. A send node sources its content from EXACTLY ONE of `message.template` (a single notification template) or `experiment` (an A/B split across weighted template variants) — supplying both, or neither, is rejected. Optionally override the recipient address, delay the send, or attach `data`.
17
+ # Send to the recipient. A send node sources its content from EXACTLY ONE of `message.template` (a single notification template) or `experiment` (an A/B split across weighted template variants) — supplying both, or neither, is rejected. Optionally override the recipient address, send as a tenant, delay the send, or attach `data`.
18
18
  variant -> { Courier::JourneySendNode }
19
19
 
20
20
  # Pause the journey run for a fixed `duration`.
@@ -41,8 +41,8 @@ module Courier
41
41
  # Send to the recipient. A send node sources its content from EXACTLY ONE of
42
42
  # `message.template` (a single notification template) or `experiment` (an A/B
43
43
  # split across weighted template variants) — supplying both, or neither, is
44
- # rejected. Optionally override the recipient address, delay the send, or attach
45
- # `data`.
44
+ # rejected. Optionally override the recipient address, send as a tenant, delay the
45
+ # send, or attach `data`.
46
46
  #
47
47
  # @param message [Courier::Models::JourneySendNode::Message]
48
48
  #
@@ -56,6 +56,13 @@ module Courier
56
56
 
57
57
  # @see Courier::Models::JourneySendNode#message
58
58
  class Message < Courier::Internal::Type::BaseModel
59
+ # @!attribute context
60
+ # Tenant context for this send. Set it to deliver on behalf of one of your
61
+ # customers, so the message uses that tenant's brand and settings.
62
+ #
63
+ # @return [Courier::Models::JourneySendNode::Message::Context, nil]
64
+ optional :context, -> { Courier::JourneySendNode::Message::Context }
65
+
59
66
  # @!attribute data
60
67
  #
61
68
  # @return [Hash{Symbol=>Object}, nil]
@@ -76,12 +83,48 @@ module Courier
76
83
  # @return [Courier::Models::JourneySendNode::Message::To, nil]
77
84
  optional :to, -> { Courier::JourneySendNode::Message::To }
78
85
 
79
- # @!method initialize(data: nil, delay: nil, template: nil, to: nil)
86
+ # @!method initialize(context: nil, data: nil, delay: nil, template: nil, to: nil)
87
+ # Some parameter documentations has been truncated, see
88
+ # {Courier::Models::JourneySendNode::Message} for more details.
89
+ #
90
+ # @param context [Courier::Models::JourneySendNode::Message::Context] Tenant context for this send. Set it to deliver on behalf of one of your custome
91
+ #
80
92
  # @param data [Hash{Symbol=>Object}]
93
+ #
81
94
  # @param delay [Courier::Models::JourneySendNode::Message::Delay]
95
+ #
82
96
  # @param template [String]
97
+ #
83
98
  # @param to [Courier::Models::JourneySendNode::Message::To]
84
99
 
100
+ # @see Courier::Models::JourneySendNode::Message#context
101
+ class Context < Courier::Internal::Type::BaseModel
102
+ # @!attribute tenant_id
103
+ # The tenant to send as. Accepts either a literal tenant id (`acme-tenant`) or a
104
+ # whole-string mustache reference to a value the run already holds —
105
+ # `{{data.tenant_id}}` from the invocation payload, or `{{f1.body.tenant_id}}`
106
+ # from the response of an earlier fetch node with id `f1`. A reference is resolved
107
+ # separately on every run, so a single journey can deliver as many tenants. Two
108
+ # forms are rejected with `400`: mid-string interpolation such as
109
+ # `tenant-{{data.region}}`, and any value beginning with `refs.`, which is
110
+ # reserved for internal use. A reference that resolves to nothing at run time does
111
+ # not stop the run — the message is still sent, with no tenant context — so make
112
+ # sure the referenced value is always present. `GET` returns the value in the same
113
+ # form it was supplied.
114
+ #
115
+ # @return [String]
116
+ required :tenant_id, String
117
+
118
+ # @!method initialize(tenant_id:)
119
+ # Some parameter documentations has been truncated, see
120
+ # {Courier::Models::JourneySendNode::Message::Context} for more details.
121
+ #
122
+ # Tenant context for this send. Set it to deliver on behalf of one of your
123
+ # customers, so the message uses that tenant's brand and settings.
124
+ #
125
+ # @param tenant_id [String] The tenant to send as. Accepts either a literal tenant id (`acme-tenant`) or a w
126
+ end
127
+
85
128
  # @see Courier::Models::JourneySendNode::Message#delay
86
129
  class Delay < Courier::Internal::Type::BaseModel
87
130
  # @!attribute until_
@@ -215,8 +215,6 @@ module Courier
215
215
 
216
216
  InboundTrackEventParams = Courier::Models::InboundTrackEventParams
217
217
 
218
- Inbox = Courier::Models::Inbox
219
-
220
218
  Intercom = Courier::Models::Intercom
221
219
 
222
220
  IntercomRecipient = Courier::Models::IntercomRecipient
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Create a one-off send to a list or audience, author its content, then send it
6
+ # immediately or schedule it for later.
5
7
  class Broadcasts
6
8
  # Create a broadcast. Provisions a private notification template for the broadcast
7
9
  # and returns the new broadcast in the draft state. Exactly one channel is
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.23.0"
4
+ VERSION = "4.24.0"
5
5
  end
data/lib/courier.rb CHANGED
@@ -176,8 +176,6 @@ require_relative "courier/models/filter_config"
176
176
  require_relative "courier/models/icons"
177
177
  require_relative "courier/models/inbound_track_event_params"
178
178
  require_relative "courier/models/inbound_track_event_response"
179
- require_relative "courier/models/inbox/message_delete_params"
180
- require_relative "courier/models/inbox/message_restore_params"
181
179
  require_relative "courier/models/intercom"
182
180
  require_relative "courier/models/intercom_recipient"
183
181
  require_relative "courier/models/journey"
@@ -445,8 +443,6 @@ require_relative "courier/resources/broadcasts"
445
443
  require_relative "courier/resources/digests"
446
444
  require_relative "courier/resources/digests/schedules"
447
445
  require_relative "courier/resources/inbound"
448
- require_relative "courier/resources/inbox"
449
- require_relative "courier/resources/inbox/messages"
450
446
  require_relative "courier/resources/journeys"
451
447
  require_relative "courier/resources/journeys/templates"
452
448
  require_relative "courier/resources/lists"
@@ -48,6 +48,8 @@ module Courier
48
48
  sig { returns(Courier::Resources::Journeys) }
49
49
  attr_reader :journeys
50
50
 
51
+ # Create a one-off send to a list or audience, author its content, then send it
52
+ # immediately or schedule it for later.
51
53
  sig { returns(Courier::Resources::Broadcasts) }
52
54
  attr_reader :broadcasts
53
55
 
@@ -68,9 +70,6 @@ module Courier
68
70
  sig { returns(Courier::Resources::Lists) }
69
71
  attr_reader :lists
70
72
 
71
- sig { returns(Courier::Resources::Inbox) }
72
- attr_reader :inbox
73
-
74
73
  # Look up the messages Courier has accepted, inspect their delivery history and
75
74
  # rendered output, and cancel, resend, or archive them.
76
75
  sig { returns(Courier::Resources::Messages) }
@@ -63,8 +63,8 @@ module Courier
63
63
  # Send to the recipient. A send node sources its content from EXACTLY ONE of
64
64
  # `message.template` (a single notification template) or `experiment` (an A/B
65
65
  # split across weighted template variants) — supplying both, or neither, is
66
- # rejected. Optionally override the recipient address, delay the send, or attach
67
- # `data`.
66
+ # rejected. Optionally override the recipient address, send as a tenant, delay the
67
+ # send, or attach `data`.
68
68
  sig do
69
69
  params(
70
70
  message: Courier::JourneySendNode::Message::OrHash,
@@ -119,6 +119,18 @@ module Courier
119
119
  T.any(Courier::JourneySendNode::Message, Courier::Internal::AnyHash)
120
120
  end
121
121
 
122
+ # Tenant context for this send. Set it to deliver on behalf of one of your
123
+ # customers, so the message uses that tenant's brand and settings.
124
+ sig { returns(T.nilable(Courier::JourneySendNode::Message::Context)) }
125
+ attr_reader :context
126
+
127
+ sig do
128
+ params(
129
+ context: Courier::JourneySendNode::Message::Context::OrHash
130
+ ).void
131
+ end
132
+ attr_writer :context
133
+
122
134
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
123
135
  attr_reader :data
124
136
 
@@ -147,18 +159,28 @@ module Courier
147
159
 
148
160
  sig do
149
161
  params(
162
+ context: Courier::JourneySendNode::Message::Context::OrHash,
150
163
  data: T::Hash[Symbol, T.anything],
151
164
  delay: Courier::JourneySendNode::Message::Delay::OrHash,
152
165
  template: String,
153
166
  to: Courier::JourneySendNode::Message::To::OrHash
154
167
  ).returns(T.attached_class)
155
168
  end
156
- def self.new(data: nil, delay: nil, template: nil, to: nil)
169
+ def self.new(
170
+ # Tenant context for this send. Set it to deliver on behalf of one of your
171
+ # customers, so the message uses that tenant's brand and settings.
172
+ context: nil,
173
+ data: nil,
174
+ delay: nil,
175
+ template: nil,
176
+ to: nil
177
+ )
157
178
  end
158
179
 
159
180
  sig do
160
181
  override.returns(
161
182
  {
183
+ context: Courier::JourneySendNode::Message::Context,
162
184
  data: T::Hash[Symbol, T.anything],
163
185
  delay: Courier::JourneySendNode::Message::Delay,
164
186
  template: String,
@@ -169,6 +191,53 @@ module Courier
169
191
  def to_hash
170
192
  end
171
193
 
194
+ class Context < Courier::Internal::Type::BaseModel
195
+ OrHash =
196
+ T.type_alias do
197
+ T.any(
198
+ Courier::JourneySendNode::Message::Context,
199
+ Courier::Internal::AnyHash
200
+ )
201
+ end
202
+
203
+ # The tenant to send as. Accepts either a literal tenant id (`acme-tenant`) or a
204
+ # whole-string mustache reference to a value the run already holds —
205
+ # `{{data.tenant_id}}` from the invocation payload, or `{{f1.body.tenant_id}}`
206
+ # from the response of an earlier fetch node with id `f1`. A reference is resolved
207
+ # separately on every run, so a single journey can deliver as many tenants. Two
208
+ # forms are rejected with `400`: mid-string interpolation such as
209
+ # `tenant-{{data.region}}`, and any value beginning with `refs.`, which is
210
+ # reserved for internal use. A reference that resolves to nothing at run time does
211
+ # not stop the run — the message is still sent, with no tenant context — so make
212
+ # sure the referenced value is always present. `GET` returns the value in the same
213
+ # form it was supplied.
214
+ sig { returns(String) }
215
+ attr_accessor :tenant_id
216
+
217
+ # Tenant context for this send. Set it to deliver on behalf of one of your
218
+ # customers, so the message uses that tenant's brand and settings.
219
+ sig { params(tenant_id: String).returns(T.attached_class) }
220
+ def self.new(
221
+ # The tenant to send as. Accepts either a literal tenant id (`acme-tenant`) or a
222
+ # whole-string mustache reference to a value the run already holds —
223
+ # `{{data.tenant_id}}` from the invocation payload, or `{{f1.body.tenant_id}}`
224
+ # from the response of an earlier fetch node with id `f1`. A reference is resolved
225
+ # separately on every run, so a single journey can deliver as many tenants. Two
226
+ # forms are rejected with `400`: mid-string interpolation such as
227
+ # `tenant-{{data.region}}`, and any value beginning with `refs.`, which is
228
+ # reserved for internal use. A reference that resolves to nothing at run time does
229
+ # not stop the run — the message is still sent, with no tenant context — so make
230
+ # sure the referenced value is always present. `GET` returns the value in the same
231
+ # form it was supplied.
232
+ tenant_id:
233
+ )
234
+ end
235
+
236
+ sig { override.returns({ tenant_id: String }) }
237
+ def to_hash
238
+ end
239
+ end
240
+
172
241
  class Delay < Courier::Internal::Type::BaseModel
173
242
  OrHash =
174
243
  T.type_alias do
@@ -180,8 +180,6 @@ module Courier
180
180
 
181
181
  InboundTrackEventParams = Courier::Models::InboundTrackEventParams
182
182
 
183
- Inbox = Courier::Models::Inbox
184
-
185
183
  Intercom = Courier::Models::Intercom
186
184
 
187
185
  IntercomRecipient = Courier::Models::IntercomRecipient
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Create a one-off send to a list or audience, author its content, then send it
6
+ # immediately or schedule it for later.
5
7
  class Broadcasts
6
8
  # Create a broadcast. Provisions a private notification template for the broadcast
7
9
  # and returns the new broadcast in the draft state. Exactly one channel is
@@ -34,8 +34,6 @@ module Courier
34
34
 
35
35
  attr_reader lists: Courier::Resources::Lists
36
36
 
37
- attr_reader inbox: Courier::Resources::Inbox
38
-
39
37
  attr_reader messages: Courier::Resources::Messages
40
38
 
41
39
  attr_reader requests: Courier::Resources::Requests
@@ -48,6 +48,7 @@ module Courier
48
48
 
49
49
  type message =
50
50
  {
51
+ context: Courier::JourneySendNode::Message::Context,
51
52
  data: ::Hash[Symbol, top],
52
53
  delay: Courier::JourneySendNode::Message::Delay,
53
54
  template: String,
@@ -55,6 +56,12 @@ module Courier
55
56
  }
56
57
 
57
58
  class Message < Courier::Internal::Type::BaseModel
59
+ attr_reader context: Courier::JourneySendNode::Message::Context?
60
+
61
+ def context=: (
62
+ Courier::JourneySendNode::Message::Context
63
+ ) -> Courier::JourneySendNode::Message::Context
64
+
58
65
  attr_reader data: ::Hash[Symbol, top]?
59
66
 
60
67
  def data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
@@ -76,6 +83,7 @@ module Courier
76
83
  ) -> Courier::JourneySendNode::Message::To
77
84
 
78
85
  def initialize: (
86
+ ?context: Courier::JourneySendNode::Message::Context,
79
87
  ?data: ::Hash[Symbol, top],
80
88
  ?delay: Courier::JourneySendNode::Message::Delay,
81
89
  ?template: String,
@@ -83,12 +91,23 @@ module Courier
83
91
  ) -> void
84
92
 
85
93
  def to_hash: -> {
94
+ context: Courier::JourneySendNode::Message::Context,
86
95
  data: ::Hash[Symbol, top],
87
96
  delay: Courier::JourneySendNode::Message::Delay,
88
97
  template: String,
89
98
  to: Courier::JourneySendNode::Message::To
90
99
  }
91
100
 
101
+ type context = { tenant_id: String }
102
+
103
+ class Context < Courier::Internal::Type::BaseModel
104
+ attr_accessor tenant_id: String
105
+
106
+ def initialize: (tenant_id: String) -> void
107
+
108
+ def to_hash: -> { tenant_id: String }
109
+ end
110
+
92
111
  type delay = { until_: String, timezone: String }
93
112
 
94
113
  class Delay < Courier::Internal::Type::BaseModel
@@ -175,8 +175,6 @@ module Courier
175
175
 
176
176
  class InboundTrackEventParams = Courier::Models::InboundTrackEventParams
177
177
 
178
- module Inbox = Courier::Models::Inbox
179
-
180
178
  class Intercom = Courier::Models::Intercom
181
179
 
182
180
  class IntercomRecipient = Courier::Models::IntercomRecipient
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trycourier
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.23.0
4
+ version: 4.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-29 00:00:00.000000000 Z
11
+ date: 2026-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi
@@ -166,8 +166,6 @@ files:
166
166
  - lib/courier/models/icons.rb
167
167
  - lib/courier/models/inbound_track_event_params.rb
168
168
  - lib/courier/models/inbound_track_event_response.rb
169
- - lib/courier/models/inbox/message_delete_params.rb
170
- - lib/courier/models/inbox/message_restore_params.rb
171
169
  - lib/courier/models/intercom.rb
172
170
  - lib/courier/models/intercom_recipient.rb
173
171
  - lib/courier/models/journey.rb
@@ -462,8 +460,6 @@ files:
462
460
  - lib/courier/resources/digests.rb
463
461
  - lib/courier/resources/digests/schedules.rb
464
462
  - lib/courier/resources/inbound.rb
465
- - lib/courier/resources/inbox.rb
466
- - lib/courier/resources/inbox/messages.rb
467
463
  - lib/courier/resources/journeys.rb
468
464
  - lib/courier/resources/journeys/templates.rb
469
465
  - lib/courier/resources/lists.rb
@@ -608,8 +604,6 @@ files:
608
604
  - rbi/courier/models/icons.rbi
609
605
  - rbi/courier/models/inbound_track_event_params.rbi
610
606
  - rbi/courier/models/inbound_track_event_response.rbi
611
- - rbi/courier/models/inbox/message_delete_params.rbi
612
- - rbi/courier/models/inbox/message_restore_params.rbi
613
607
  - rbi/courier/models/intercom.rbi
614
608
  - rbi/courier/models/intercom_recipient.rbi
615
609
  - rbi/courier/models/journey.rbi
@@ -904,8 +898,6 @@ files:
904
898
  - rbi/courier/resources/digests.rbi
905
899
  - rbi/courier/resources/digests/schedules.rbi
906
900
  - rbi/courier/resources/inbound.rbi
907
- - rbi/courier/resources/inbox.rbi
908
- - rbi/courier/resources/inbox/messages.rbi
909
901
  - rbi/courier/resources/journeys.rbi
910
902
  - rbi/courier/resources/journeys/templates.rbi
911
903
  - rbi/courier/resources/lists.rbi
@@ -1049,8 +1041,6 @@ files:
1049
1041
  - sig/courier/models/icons.rbs
1050
1042
  - sig/courier/models/inbound_track_event_params.rbs
1051
1043
  - sig/courier/models/inbound_track_event_response.rbs
1052
- - sig/courier/models/inbox/message_delete_params.rbs
1053
- - sig/courier/models/inbox/message_restore_params.rbs
1054
1044
  - sig/courier/models/intercom.rbs
1055
1045
  - sig/courier/models/intercom_recipient.rbs
1056
1046
  - sig/courier/models/journey.rbs
@@ -1345,8 +1335,6 @@ files:
1345
1335
  - sig/courier/resources/digests.rbs
1346
1336
  - sig/courier/resources/digests/schedules.rbs
1347
1337
  - sig/courier/resources/inbound.rbs
1348
- - sig/courier/resources/inbox.rbs
1349
- - sig/courier/resources/inbox/messages.rbs
1350
1338
  - sig/courier/resources/journeys.rbs
1351
1339
  - sig/courier/resources/journeys/templates.rbs
1352
1340
  - sig/courier/resources/lists.rbs
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- module Inbox
6
- # @see Courier::Resources::Inbox::Messages#delete
7
- class MessageDeleteParams < Courier::Internal::Type::BaseModel
8
- extend Courier::Internal::Type::RequestParameters::Converter
9
- include Courier::Internal::Type::RequestParameters
10
-
11
- # @!attribute message_id
12
- #
13
- # @return [String]
14
- required :message_id, String
15
-
16
- # @!method initialize(message_id:, request_options: {})
17
- # @param message_id [String]
18
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
19
- end
20
- end
21
- end
22
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- module Inbox
6
- # @see Courier::Resources::Inbox::Messages#restore
7
- class MessageRestoreParams < Courier::Internal::Type::BaseModel
8
- extend Courier::Internal::Type::RequestParameters::Converter
9
- include Courier::Internal::Type::RequestParameters
10
-
11
- # @!attribute message_id
12
- #
13
- # @return [String]
14
- required :message_id, String
15
-
16
- # @!method initialize(message_id:, request_options: {})
17
- # @param message_id [String]
18
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
19
- end
20
- end
21
- end
22
- end
@@ -1,58 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Resources
5
- class Inbox
6
- # Manage the messages in a user's in-app inbox.
7
- class Messages
8
- # Delete a user's inbox message. The message is removed from every inbox read (it
9
- # stops appearing in the recipient's Inbox); it can be restored.
10
- #
11
- # @overload delete(message_id, request_options: {})
12
- #
13
- # @param message_id [String] The message ID of the inbox message to delete.
14
- #
15
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
16
- #
17
- # @return [nil]
18
- #
19
- # @see Courier::Models::Inbox::MessageDeleteParams
20
- def delete(message_id, params = {})
21
- @client.request(
22
- method: :delete,
23
- path: ["inbox/messages/%1$s", message_id],
24
- model: NilClass,
25
- options: params[:request_options]
26
- )
27
- end
28
-
29
- # Restore a previously deleted inbox message.
30
- #
31
- # @overload restore(message_id, request_options: {})
32
- #
33
- # @param message_id [String] The message ID of the inbox message to restore.
34
- #
35
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
36
- #
37
- # @return [nil]
38
- #
39
- # @see Courier::Models::Inbox::MessageRestoreParams
40
- def restore(message_id, params = {})
41
- @client.request(
42
- method: :put,
43
- path: ["inbox/messages/%1$s/restore", message_id],
44
- model: NilClass,
45
- options: params[:request_options]
46
- )
47
- end
48
-
49
- # @api private
50
- #
51
- # @param client [Courier::Client]
52
- def initialize(client:)
53
- @client = client
54
- end
55
- end
56
- end
57
- end
58
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Resources
5
- class Inbox
6
- # Manage the messages in a user's in-app inbox.
7
- # @return [Courier::Resources::Inbox::Messages]
8
- attr_reader :messages
9
-
10
- # @api private
11
- #
12
- # @param client [Courier::Client]
13
- def initialize(client:)
14
- @client = client
15
- @messages = Courier::Resources::Inbox::Messages.new(client: client)
16
- end
17
- end
18
- end
19
- end
@@ -1,40 +0,0 @@
1
- # typed: strong
2
-
3
- module Courier
4
- module Models
5
- module Inbox
6
- class MessageDeleteParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- OrHash =
11
- T.type_alias do
12
- T.any(
13
- Courier::Inbox::MessageDeleteParams,
14
- Courier::Internal::AnyHash
15
- )
16
- end
17
-
18
- sig { returns(String) }
19
- attr_accessor :message_id
20
-
21
- sig do
22
- params(
23
- message_id: String,
24
- request_options: Courier::RequestOptions::OrHash
25
- ).returns(T.attached_class)
26
- end
27
- def self.new(message_id:, request_options: {})
28
- end
29
-
30
- sig do
31
- override.returns(
32
- { message_id: String, request_options: Courier::RequestOptions }
33
- )
34
- end
35
- def to_hash
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,40 +0,0 @@
1
- # typed: strong
2
-
3
- module Courier
4
- module Models
5
- module Inbox
6
- class MessageRestoreParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- OrHash =
11
- T.type_alias do
12
- T.any(
13
- Courier::Inbox::MessageRestoreParams,
14
- Courier::Internal::AnyHash
15
- )
16
- end
17
-
18
- sig { returns(String) }
19
- attr_accessor :message_id
20
-
21
- sig do
22
- params(
23
- message_id: String,
24
- request_options: Courier::RequestOptions::OrHash
25
- ).returns(T.attached_class)
26
- end
27
- def self.new(message_id:, request_options: {})
28
- end
29
-
30
- sig do
31
- override.returns(
32
- { message_id: String, request_options: Courier::RequestOptions }
33
- )
34
- end
35
- def to_hash
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,44 +0,0 @@
1
- # typed: strong
2
-
3
- module Courier
4
- module Resources
5
- class Inbox
6
- # Manage the messages in a user's in-app inbox.
7
- class Messages
8
- # Delete a user's inbox message. The message is removed from every inbox read (it
9
- # stops appearing in the recipient's Inbox); it can be restored.
10
- sig do
11
- params(
12
- message_id: String,
13
- request_options: Courier::RequestOptions::OrHash
14
- ).void
15
- end
16
- def delete(
17
- # The message ID of the inbox message to delete.
18
- message_id,
19
- request_options: {}
20
- )
21
- end
22
-
23
- # Restore a previously deleted inbox message.
24
- sig do
25
- params(
26
- message_id: String,
27
- request_options: Courier::RequestOptions::OrHash
28
- ).void
29
- end
30
- def restore(
31
- # The message ID of the inbox message to restore.
32
- message_id,
33
- request_options: {}
34
- )
35
- end
36
-
37
- # @api private
38
- sig { params(client: Courier::Client).returns(T.attached_class) }
39
- def self.new(client:)
40
- end
41
- end
42
- end
43
- end
44
- end
@@ -1,16 +0,0 @@
1
- # typed: strong
2
-
3
- module Courier
4
- module Resources
5
- class Inbox
6
- # Manage the messages in a user's in-app inbox.
7
- sig { returns(Courier::Resources::Inbox::Messages) }
8
- attr_reader :messages
9
-
10
- # @api private
11
- sig { params(client: Courier::Client).returns(T.attached_class) }
12
- def self.new(client:)
13
- end
14
- end
15
- end
16
- end
@@ -1,25 +0,0 @@
1
- module Courier
2
- module Models
3
- module Inbox
4
- type message_delete_params =
5
- { message_id: String } & Courier::Internal::Type::request_parameters
6
-
7
- class MessageDeleteParams < Courier::Internal::Type::BaseModel
8
- extend Courier::Internal::Type::RequestParameters::Converter
9
- include Courier::Internal::Type::RequestParameters
10
-
11
- attr_accessor message_id: String
12
-
13
- def initialize: (
14
- message_id: String,
15
- ?request_options: Courier::request_opts
16
- ) -> void
17
-
18
- def to_hash: -> {
19
- message_id: String,
20
- request_options: Courier::RequestOptions
21
- }
22
- end
23
- end
24
- end
25
- end
@@ -1,25 +0,0 @@
1
- module Courier
2
- module Models
3
- module Inbox
4
- type message_restore_params =
5
- { message_id: String } & Courier::Internal::Type::request_parameters
6
-
7
- class MessageRestoreParams < Courier::Internal::Type::BaseModel
8
- extend Courier::Internal::Type::RequestParameters::Converter
9
- include Courier::Internal::Type::RequestParameters
10
-
11
- attr_accessor message_id: String
12
-
13
- def initialize: (
14
- message_id: String,
15
- ?request_options: Courier::request_opts
16
- ) -> void
17
-
18
- def to_hash: -> {
19
- message_id: String,
20
- request_options: Courier::RequestOptions
21
- }
22
- end
23
- end
24
- end
25
- end
@@ -1,19 +0,0 @@
1
- module Courier
2
- module Resources
3
- class Inbox
4
- class Messages
5
- def delete: (
6
- String message_id,
7
- ?request_options: Courier::request_opts
8
- ) -> nil
9
-
10
- def restore: (
11
- String message_id,
12
- ?request_options: Courier::request_opts
13
- ) -> nil
14
-
15
- def initialize: (client: Courier::Client) -> void
16
- end
17
- end
18
- end
19
- end
@@ -1,9 +0,0 @@
1
- module Courier
2
- module Resources
3
- class Inbox
4
- attr_reader messages: Courier::Resources::Inbox::Messages
5
-
6
- def initialize: (client: Courier::Client) -> void
7
- end
8
- end
9
- end