sentdm 0.31.0 → 0.32.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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/models/channel_event.rb +78 -0
  5. data/lib/sentdm/models/channel_event_payload.rb +128 -0
  6. data/lib/sentdm/models/contact_event.rb +69 -0
  7. data/lib/sentdm/models/contact_event_payload.rb +111 -0
  8. data/lib/sentdm/models/inbound_message_event.rb +16 -8
  9. data/lib/sentdm/models/message_event.rb +16 -8
  10. data/lib/sentdm/models/message_event_payload.rb +11 -1
  11. data/lib/sentdm/models/template.rb +36 -5
  12. data/lib/sentdm/models/template_body.rb +20 -11
  13. data/lib/sentdm/models/template_body_content.rb +35 -3
  14. data/lib/sentdm/models/template_button.rb +8 -2
  15. data/lib/sentdm/models/template_button_props.rb +12 -1
  16. data/lib/sentdm/models/template_definition.rb +14 -2
  17. data/lib/sentdm/models/template_event.rb +16 -8
  18. data/lib/sentdm/models/template_event_payload.rb +31 -4
  19. data/lib/sentdm/models/template_variable.rb +20 -3
  20. data/lib/sentdm/models/webhook_list_events_response.rb +17 -9
  21. data/lib/sentdm/models.rb +8 -0
  22. data/lib/sentdm/resources/templates.rb +28 -2
  23. data/lib/sentdm/version.rb +1 -1
  24. data/lib/sentdm.rb +4 -0
  25. data/rbi/sentdm/models/channel_event.rbi +128 -0
  26. data/rbi/sentdm/models/channel_event_payload.rbi +189 -0
  27. data/rbi/sentdm/models/contact_event.rbi +110 -0
  28. data/rbi/sentdm/models/contact_event_payload.rbi +164 -0
  29. data/rbi/sentdm/models/inbound_message_event.rbi +18 -10
  30. data/rbi/sentdm/models/message_event.rbi +18 -10
  31. data/rbi/sentdm/models/message_event_payload.rbi +12 -0
  32. data/rbi/sentdm/models/template.rbi +58 -4
  33. data/rbi/sentdm/models/template_body.rbi +22 -13
  34. data/rbi/sentdm/models/template_body_content.rbi +59 -1
  35. data/rbi/sentdm/models/template_button.rbi +14 -2
  36. data/rbi/sentdm/models/template_button_props.rbi +22 -0
  37. data/rbi/sentdm/models/template_definition.rbi +20 -2
  38. data/rbi/sentdm/models/template_event.rbi +18 -10
  39. data/rbi/sentdm/models/template_event_payload.rbi +51 -8
  40. data/rbi/sentdm/models/template_variable.rbi +28 -1
  41. data/rbi/sentdm/models/webhook_list_events_response.rbi +18 -12
  42. data/rbi/sentdm/models.rbi +8 -0
  43. data/rbi/sentdm/resources/templates.rbi +28 -2
  44. data/sig/sentdm/models/channel_event.rbs +44 -0
  45. data/sig/sentdm/models/channel_event_payload.rbs +63 -0
  46. data/sig/sentdm/models/contact_event.rbs +44 -0
  47. data/sig/sentdm/models/contact_event_payload.rbs +63 -0
  48. data/sig/sentdm/models/inbound_message_event.rbs +5 -0
  49. data/sig/sentdm/models/message_event.rbs +5 -0
  50. data/sig/sentdm/models/message_event_payload.rbs +5 -0
  51. data/sig/sentdm/models/template.rbs +5 -0
  52. data/sig/sentdm/models/template_event.rbs +5 -0
  53. data/sig/sentdm/models/template_event_payload.rbs +9 -6
  54. data/sig/sentdm/models/webhook_list_events_response.rbs +2 -0
  55. data/sig/sentdm/models.rbs +8 -0
  56. metadata +14 -2
@@ -31,10 +31,18 @@ module Sentdm
31
31
 
32
32
  BrandsBrandData = Sentdm::Models::BrandsBrandData
33
33
 
34
+ ChannelEvent = Sentdm::Models::ChannelEvent
35
+
36
+ ChannelEventPayload = Sentdm::Models::ChannelEventPayload
37
+
34
38
  ContactCreateParams = Sentdm::Models::ContactCreateParams
35
39
 
36
40
  ContactDeleteParams = Sentdm::Models::ContactDeleteParams
37
41
 
42
+ ContactEvent = Sentdm::Models::ContactEvent
43
+
44
+ ContactEventPayload = Sentdm::Models::ContactEventPayload
45
+
38
46
  ContactListParams = Sentdm::Models::ContactListParams
39
47
 
40
48
  ContactMessageSummary = Sentdm::Models::ContactMessageSummary
@@ -12,7 +12,9 @@ module Sentdm
12
12
  class Templates
13
13
  # Creates a new message template with header, body, footer, and buttons. The
14
14
  # template can be submitted for review immediately or saved as draft for later
15
- # submission.
15
+ # submission. There is no `name` field on create — the display name is derived
16
+ # from the template's content and can be changed afterwards with
17
+ # `PUT /v3/templates/{id}`.
16
18
  sig do
17
19
  params(
18
20
  category: T.nilable(String),
@@ -76,7 +78,31 @@ module Sentdm
76
78
  end
77
79
 
78
80
  # Updates an existing template's name, category, language, definition, or submits
79
- # it for review.
81
+ # it for review. While the template is in review (status PENDING, or any channel
82
+ # awaiting a verdict) its definition, category and language are frozen and a
83
+ # resubmission is refused — those requests answer 409 CONFLICT_006. The display
84
+ # name stays editable throughout.
85
+ #
86
+ # `definition`, `category` and `language` are editable only from status DRAFT,
87
+ # REJECTED or APPROVED. An edit to any of them on a template in another state
88
+ # (PAUSED, DISABLED or REVOKED) is refused with 400 VALIDATION_001 and the detail
89
+ # "Template (except display name) cannot be updated unless it is in draft or
90
+ # rejected status"; `name` stays editable in every state. `submit_for_review` on a
91
+ # PAUSED, DISABLED or REVOKED template is accepted and answers 200, but opens no
92
+ # review and does not move the status — only the reviewer can reinstate it.
93
+ #
94
+ # Editing an APPROVED template is a live edit: the new content is stored
95
+ # immediately, and sending `submit_for_review: true` re-opens review, which
96
+ # returns the affected channels to PENDING so they stop sending until they are
97
+ # approved again. The previously approved content is never sent during re-review.
98
+ # Watch the per-channel `templates` webhook events rather than assuming the
99
+ # template-level status.
100
+ #
101
+ # Templates provisioned by Sent (light-onboarding templates, whose names carry the
102
+ # reserved `sent_` prefix) are read-only: every field is refused with 400
103
+ # VALIDATION*001 and the detail "This template is read-only. Only 'submit for
104
+ # review' is allowed.", and only `submit_for_review` is accepted. A `name`
105
+ # starting with `sent*` is refused for the same reason — the prefix is reserved.
80
106
  sig do
81
107
  params(
82
108
  id: String,
@@ -0,0 +1,44 @@
1
+ module Sentdm
2
+ module Models
3
+ type channel_event =
4
+ {
5
+ event: String?,
6
+ field: String,
7
+ payload: Sentdm::ChannelEventPayload?,
8
+ request_id: String?,
9
+ timestamp: String
10
+ }
11
+
12
+ class ChannelEvent < Sentdm::Internal::Type::BaseModel
13
+ attr_accessor event: String?
14
+
15
+ attr_reader field: String?
16
+
17
+ def field=: (String) -> String
18
+
19
+ attr_accessor payload: Sentdm::ChannelEventPayload?
20
+
21
+ attr_accessor request_id: String?
22
+
23
+ attr_reader timestamp: String?
24
+
25
+ def timestamp=: (String) -> String
26
+
27
+ def initialize: (
28
+ ?event: String?,
29
+ ?field: String,
30
+ ?payload: Sentdm::ChannelEventPayload?,
31
+ ?request_id: String?,
32
+ ?timestamp: String
33
+ ) -> void
34
+
35
+ def to_hash: -> {
36
+ event: String?,
37
+ field: String,
38
+ payload: Sentdm::ChannelEventPayload?,
39
+ request_id: String?,
40
+ timestamp: String
41
+ }
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,63 @@
1
+ module Sentdm
2
+ module Models
3
+ type channel_event_payload =
4
+ {
5
+ country: String,
6
+ account_id: String,
7
+ channel: String,
8
+ number_type: String?,
9
+ reason: String?,
10
+ sender_value: String?,
11
+ status: String,
12
+ updated_at: String
13
+ }
14
+
15
+ class ChannelEventPayload < Sentdm::Internal::Type::BaseModel
16
+ attr_accessor country: String
17
+
18
+ attr_reader account_id: String?
19
+
20
+ def account_id=: (String) -> String
21
+
22
+ attr_reader channel: String?
23
+
24
+ def channel=: (String) -> String
25
+
26
+ attr_accessor number_type: String?
27
+
28
+ attr_accessor reason: String?
29
+
30
+ attr_accessor sender_value: String?
31
+
32
+ attr_reader status: String?
33
+
34
+ def status=: (String) -> String
35
+
36
+ attr_reader updated_at: String?
37
+
38
+ def updated_at=: (String) -> String
39
+
40
+ def initialize: (
41
+ country: String,
42
+ ?account_id: String,
43
+ ?channel: String,
44
+ ?number_type: String?,
45
+ ?reason: String?,
46
+ ?sender_value: String?,
47
+ ?status: String,
48
+ ?updated_at: String
49
+ ) -> void
50
+
51
+ def to_hash: -> {
52
+ country: String,
53
+ account_id: String,
54
+ channel: String,
55
+ number_type: String?,
56
+ reason: String?,
57
+ sender_value: String?,
58
+ status: String,
59
+ updated_at: String
60
+ }
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,44 @@
1
+ module Sentdm
2
+ module Models
3
+ type contact_event =
4
+ {
5
+ event: String?,
6
+ field: String,
7
+ payload: Sentdm::ContactEventPayload?,
8
+ request_id: String?,
9
+ timestamp: String
10
+ }
11
+
12
+ class ContactEvent < Sentdm::Internal::Type::BaseModel
13
+ attr_accessor event: String?
14
+
15
+ attr_reader field: String?
16
+
17
+ def field=: (String) -> String
18
+
19
+ attr_accessor payload: Sentdm::ContactEventPayload?
20
+
21
+ attr_accessor request_id: String?
22
+
23
+ attr_reader timestamp: String?
24
+
25
+ def timestamp=: (String) -> String
26
+
27
+ def initialize: (
28
+ ?event: String?,
29
+ ?field: String,
30
+ ?payload: Sentdm::ContactEventPayload?,
31
+ ?request_id: String?,
32
+ ?timestamp: String
33
+ ) -> void
34
+
35
+ def to_hash: -> {
36
+ event: String?,
37
+ field: String,
38
+ payload: Sentdm::ContactEventPayload?,
39
+ request_id: String?,
40
+ timestamp: String
41
+ }
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,63 @@
1
+ module Sentdm
2
+ module Models
3
+ type contact_event_payload =
4
+ {
5
+ opt_out: bool,
6
+ source: String,
7
+ account_id: String,
8
+ channel: String,
9
+ contact_id: String,
10
+ message_id: String?,
11
+ phone_number: String,
12
+ text: String?
13
+ }
14
+
15
+ class ContactEventPayload < Sentdm::Internal::Type::BaseModel
16
+ attr_accessor opt_out: bool
17
+
18
+ attr_accessor source: String
19
+
20
+ attr_reader account_id: String?
21
+
22
+ def account_id=: (String) -> String
23
+
24
+ attr_reader channel: String?
25
+
26
+ def channel=: (String) -> String
27
+
28
+ attr_reader contact_id: String?
29
+
30
+ def contact_id=: (String) -> String
31
+
32
+ attr_accessor message_id: String?
33
+
34
+ attr_reader phone_number: String?
35
+
36
+ def phone_number=: (String) -> String
37
+
38
+ attr_accessor text: String?
39
+
40
+ def initialize: (
41
+ opt_out: bool,
42
+ source: String,
43
+ ?account_id: String,
44
+ ?channel: String,
45
+ ?contact_id: String,
46
+ ?message_id: String?,
47
+ ?phone_number: String,
48
+ ?text: String?
49
+ ) -> void
50
+
51
+ def to_hash: -> {
52
+ opt_out: bool,
53
+ source: String,
54
+ account_id: String,
55
+ channel: String,
56
+ contact_id: String,
57
+ message_id: String?,
58
+ phone_number: String,
59
+ text: String?
60
+ }
61
+ end
62
+ end
63
+ end
@@ -5,6 +5,7 @@ module Sentdm
5
5
  event: String?,
6
6
  field: String,
7
7
  payload: Sentdm::InboundMessageEventPayload?,
8
+ request_id: String?,
8
9
  timestamp: String
9
10
  }
10
11
 
@@ -17,6 +18,8 @@ module Sentdm
17
18
 
18
19
  attr_accessor payload: Sentdm::InboundMessageEventPayload?
19
20
 
21
+ attr_accessor request_id: String?
22
+
20
23
  attr_reader timestamp: String?
21
24
 
22
25
  def timestamp=: (String) -> String
@@ -25,6 +28,7 @@ module Sentdm
25
28
  ?event: String?,
26
29
  ?field: String,
27
30
  ?payload: Sentdm::InboundMessageEventPayload?,
31
+ ?request_id: String?,
28
32
  ?timestamp: String
29
33
  ) -> void
30
34
 
@@ -32,6 +36,7 @@ module Sentdm
32
36
  event: String?,
33
37
  field: String,
34
38
  payload: Sentdm::InboundMessageEventPayload?,
39
+ request_id: String?,
35
40
  timestamp: String
36
41
  }
37
42
  end
@@ -5,6 +5,7 @@ module Sentdm
5
5
  event: String?,
6
6
  field: String,
7
7
  payload: Sentdm::MessageEventPayload?,
8
+ request_id: String?,
8
9
  timestamp: String
9
10
  }
10
11
 
@@ -17,6 +18,8 @@ module Sentdm
17
18
 
18
19
  attr_accessor payload: Sentdm::MessageEventPayload?
19
20
 
21
+ attr_accessor request_id: String?
22
+
20
23
  attr_reader timestamp: String?
21
24
 
22
25
  def timestamp=: (String) -> String
@@ -25,6 +28,7 @@ module Sentdm
25
28
  ?event: String?,
26
29
  ?field: String,
27
30
  ?payload: Sentdm::MessageEventPayload?,
31
+ ?request_id: String?,
28
32
  ?timestamp: String
29
33
  ) -> void
30
34
 
@@ -32,6 +36,7 @@ module Sentdm
32
36
  event: String?,
33
37
  field: String,
34
38
  payload: Sentdm::MessageEventPayload?,
39
+ request_id: String?,
35
40
  timestamp: String
36
41
  }
37
42
  end
@@ -5,6 +5,7 @@ module Sentdm
5
5
  message_status: String,
6
6
  account_id: String,
7
7
  agent_id: String?,
8
+ body: String?,
8
9
  channel: String,
9
10
  message_id: String,
10
11
  outbound_number: String,
@@ -22,6 +23,8 @@ module Sentdm
22
23
 
23
24
  attr_accessor agent_id: String?
24
25
 
26
+ attr_accessor body: String?
27
+
25
28
  attr_reader channel: String?
26
29
 
27
30
  def channel=: (String) -> String
@@ -46,6 +49,7 @@ module Sentdm
46
49
  message_status: String,
47
50
  ?account_id: String,
48
51
  ?agent_id: String?,
52
+ ?body: String?,
49
53
  ?channel: String,
50
54
  ?message_id: String,
51
55
  ?outbound_number: String,
@@ -58,6 +62,7 @@ module Sentdm
58
62
  message_status: String,
59
63
  account_id: String,
60
64
  agent_id: String?,
65
+ body: String?,
61
66
  channel: String,
62
67
  message_id: String,
63
68
  outbound_number: String,
@@ -4,6 +4,7 @@ module Sentdm
4
4
  {
5
5
  customer_id: String,
6
6
  id: String,
7
+ auto_reply_action: String?,
7
8
  category: String,
8
9
  channels: ::Array[String]?,
9
10
  created_at: Time,
@@ -22,6 +23,8 @@ module Sentdm
22
23
 
23
24
  def id=: (String) -> String
24
25
 
26
+ attr_accessor auto_reply_action: String?
27
+
25
28
  attr_reader category: String?
26
29
 
27
30
  def category=: (String) -> String
@@ -55,6 +58,7 @@ module Sentdm
55
58
  def initialize: (
56
59
  customer_id: String,
57
60
  ?id: String,
61
+ ?auto_reply_action: String?,
58
62
  ?category: String,
59
63
  ?channels: ::Array[String]?,
60
64
  ?created_at: Time,
@@ -69,6 +73,7 @@ module Sentdm
69
73
  def to_hash: -> {
70
74
  customer_id: String,
71
75
  id: String,
76
+ auto_reply_action: String?,
72
77
  category: String,
73
78
  channels: ::Array[String]?,
74
79
  created_at: Time,
@@ -5,6 +5,7 @@ module Sentdm
5
5
  event: String?,
6
6
  field: String,
7
7
  payload: Sentdm::TemplateEventPayload?,
8
+ request_id: String?,
8
9
  timestamp: String
9
10
  }
10
11
 
@@ -17,6 +18,8 @@ module Sentdm
17
18
 
18
19
  attr_accessor payload: Sentdm::TemplateEventPayload?
19
20
 
21
+ attr_accessor request_id: String?
22
+
20
23
  attr_reader timestamp: String?
21
24
 
22
25
  def timestamp=: (String) -> String
@@ -25,6 +28,7 @@ module Sentdm
25
28
  ?event: String?,
26
29
  ?field: String,
27
30
  ?payload: Sentdm::TemplateEventPayload?,
31
+ ?request_id: String?,
28
32
  ?timestamp: String
29
33
  ) -> void
30
34
 
@@ -32,6 +36,7 @@ module Sentdm
32
36
  event: String?,
33
37
  field: String,
34
38
  payload: Sentdm::TemplateEventPayload?,
39
+ request_id: String?,
35
40
  timestamp: String
36
41
  }
37
42
  end
@@ -5,8 +5,9 @@ module Sentdm
5
5
  status: String,
6
6
  whatsapp_template_id: String,
7
7
  account_id: String,
8
+ auto_reply_action: String?,
8
9
  category: String,
9
- channel: String,
10
+ channel: String?,
10
11
  language: String,
11
12
  reason: String?,
12
13
  template_id: String,
@@ -22,13 +23,13 @@ module Sentdm
22
23
 
23
24
  def account_id=: (String) -> String
24
25
 
26
+ attr_accessor auto_reply_action: String?
27
+
25
28
  attr_reader category: String?
26
29
 
27
30
  def category=: (String) -> String
28
31
 
29
- attr_reader channel: String?
30
-
31
- def channel=: (String) -> String
32
+ attr_accessor channel: String?
32
33
 
33
34
  attr_reader language: String?
34
35
 
@@ -48,8 +49,9 @@ module Sentdm
48
49
  status: String,
49
50
  whatsapp_template_id: String,
50
51
  ?account_id: String,
52
+ ?auto_reply_action: String?,
51
53
  ?category: String,
52
- ?channel: String,
54
+ ?channel: String?,
53
55
  ?language: String,
54
56
  ?reason: String?,
55
57
  ?template_id: String,
@@ -60,8 +62,9 @@ module Sentdm
60
62
  status: String,
61
63
  whatsapp_template_id: String,
62
64
  account_id: String,
65
+ auto_reply_action: String?,
63
66
  category: String,
64
- channel: String,
67
+ channel: String?,
65
68
  language: String,
66
69
  reason: String?,
67
70
  template_id: String,
@@ -84,6 +84,8 @@ module Sentdm
84
84
  Sentdm::MessageEvent
85
85
  | Sentdm::InboundMessageEvent
86
86
  | Sentdm::TemplateEvent
87
+ | Sentdm::ChannelEvent
88
+ | Sentdm::ContactEvent
87
89
 
88
90
  module EventData
89
91
  extend Sentdm::Internal::Type::Union
@@ -27,10 +27,18 @@ module Sentdm
27
27
 
28
28
  class BrandsBrandData = Sentdm::Models::BrandsBrandData
29
29
 
30
+ class ChannelEvent = Sentdm::Models::ChannelEvent
31
+
32
+ class ChannelEventPayload = Sentdm::Models::ChannelEventPayload
33
+
30
34
  class ContactCreateParams = Sentdm::Models::ContactCreateParams
31
35
 
32
36
  class ContactDeleteParams = Sentdm::Models::ContactDeleteParams
33
37
 
38
+ class ContactEvent = Sentdm::Models::ContactEvent
39
+
40
+ class ContactEventPayload = Sentdm::Models::ContactEventPayload
41
+
34
42
  class ContactListParams = Sentdm::Models::ContactListParams
35
43
 
36
44
  class ContactMessageSummary = Sentdm::Models::ContactMessageSummary
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentdm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sent
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-10 00:00:00.000000000 Z
11
+ date: 2026-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi
@@ -88,8 +88,12 @@ files:
88
88
  - lib/sentdm/models/brand_compliance_info.rb
89
89
  - lib/sentdm/models/brand_contact_info.rb
90
90
  - lib/sentdm/models/brands_brand_data.rb
91
+ - lib/sentdm/models/channel_event.rb
92
+ - lib/sentdm/models/channel_event_payload.rb
91
93
  - lib/sentdm/models/contact_create_params.rb
92
94
  - lib/sentdm/models/contact_delete_params.rb
95
+ - lib/sentdm/models/contact_event.rb
96
+ - lib/sentdm/models/contact_event_payload.rb
93
97
  - lib/sentdm/models/contact_list_params.rb
94
98
  - lib/sentdm/models/contact_message_summary.rb
95
99
  - lib/sentdm/models/contact_response.rb
@@ -231,8 +235,12 @@ files:
231
235
  - rbi/sentdm/models/brand_compliance_info.rbi
232
236
  - rbi/sentdm/models/brand_contact_info.rbi
233
237
  - rbi/sentdm/models/brands_brand_data.rbi
238
+ - rbi/sentdm/models/channel_event.rbi
239
+ - rbi/sentdm/models/channel_event_payload.rbi
234
240
  - rbi/sentdm/models/contact_create_params.rbi
235
241
  - rbi/sentdm/models/contact_delete_params.rbi
242
+ - rbi/sentdm/models/contact_event.rbi
243
+ - rbi/sentdm/models/contact_event_payload.rbi
236
244
  - rbi/sentdm/models/contact_list_params.rbi
237
245
  - rbi/sentdm/models/contact_message_summary.rbi
238
246
  - rbi/sentdm/models/contact_response.rbi
@@ -373,8 +381,12 @@ files:
373
381
  - sig/sentdm/models/brand_compliance_info.rbs
374
382
  - sig/sentdm/models/brand_contact_info.rbs
375
383
  - sig/sentdm/models/brands_brand_data.rbs
384
+ - sig/sentdm/models/channel_event.rbs
385
+ - sig/sentdm/models/channel_event_payload.rbs
376
386
  - sig/sentdm/models/contact_create_params.rbs
377
387
  - sig/sentdm/models/contact_delete_params.rbs
388
+ - sig/sentdm/models/contact_event.rbs
389
+ - sig/sentdm/models/contact_event_payload.rbs
378
390
  - sig/sentdm/models/contact_list_params.rbs
379
391
  - sig/sentdm/models/contact_message_summary.rbs
380
392
  - sig/sentdm/models/contact_response.rbs