sentdm 0.30.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +29 -1
- data/lib/sentdm/internal/contacts_page.rb +115 -0
- data/lib/sentdm/internal/conversations_page.rb +115 -0
- data/lib/sentdm/internal/templates_page.rb +115 -0
- data/lib/sentdm/internal/webhook_events_page.rb +115 -0
- data/lib/sentdm/internal/webhooks_page.rb +115 -0
- data/lib/sentdm/models/api_response_of_conversation_messages_list.rb +0 -1
- data/lib/sentdm/models/channel_event.rb +78 -0
- data/lib/sentdm/models/channel_event_payload.rb +128 -0
- data/lib/sentdm/models/contact_event.rb +69 -0
- data/lib/sentdm/models/contact_event_payload.rb +111 -0
- data/lib/sentdm/models/contact_list_params.rb +13 -13
- data/lib/sentdm/models/contact_response.rb +1 -0
- data/lib/sentdm/models/conversation_list_messages_params.rb +5 -5
- data/lib/sentdm/models/conversation_list_params.rb +5 -5
- data/lib/sentdm/models/inbound_message_event.rb +16 -8
- data/lib/sentdm/models/message_event.rb +16 -8
- data/lib/sentdm/models/message_event_payload.rb +11 -1
- data/lib/sentdm/models/template.rb +37 -5
- data/lib/sentdm/models/template_body.rb +20 -11
- data/lib/sentdm/models/template_body_content.rb +35 -3
- data/lib/sentdm/models/template_button.rb +8 -2
- data/lib/sentdm/models/template_button_props.rb +12 -1
- data/lib/sentdm/models/template_definition.rb +14 -2
- data/lib/sentdm/models/template_event.rb +16 -8
- data/lib/sentdm/models/template_event_payload.rb +31 -4
- data/lib/sentdm/models/template_list_params.rb +17 -17
- data/lib/sentdm/models/template_variable.rb +20 -3
- data/lib/sentdm/models/webhook_list_events_params.rb +5 -5
- data/lib/sentdm/models/webhook_list_events_response.rb +116 -168
- data/lib/sentdm/models/webhook_list_params.rb +11 -11
- data/lib/sentdm/models/webhook_response.rb +1 -0
- data/lib/sentdm/models.rb +8 -0
- data/lib/sentdm/resources/contacts.rb +8 -7
- data/lib/sentdm/resources/conversations.rb +10 -8
- data/lib/sentdm/resources/templates.rb +38 -11
- data/lib/sentdm/resources/webhooks.rb +12 -10
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +9 -3
- data/rbi/sentdm/internal/contacts_page.rbi +71 -0
- data/rbi/sentdm/internal/conversations_page.rbi +71 -0
- data/rbi/sentdm/internal/templates_page.rbi +71 -0
- data/rbi/sentdm/internal/webhook_events_page.rbi +71 -0
- data/rbi/sentdm/internal/webhooks_page.rbi +71 -0
- data/rbi/sentdm/models/channel_event.rbi +128 -0
- data/rbi/sentdm/models/channel_event_payload.rbi +189 -0
- data/rbi/sentdm/models/contact_event.rbi +110 -0
- data/rbi/sentdm/models/contact_event_payload.rbi +164 -0
- data/rbi/sentdm/models/contact_list_params.rbi +19 -13
- data/rbi/sentdm/models/conversation_list_messages_params.rbi +12 -6
- data/rbi/sentdm/models/conversation_list_params.rbi +16 -5
- data/rbi/sentdm/models/inbound_message_event.rbi +18 -10
- data/rbi/sentdm/models/message_event.rbi +18 -10
- data/rbi/sentdm/models/message_event_payload.rbi +12 -0
- data/rbi/sentdm/models/template.rbi +58 -4
- data/rbi/sentdm/models/template_body.rbi +22 -13
- data/rbi/sentdm/models/template_body_content.rbi +59 -1
- data/rbi/sentdm/models/template_button.rbi +14 -2
- data/rbi/sentdm/models/template_button_props.rbi +22 -0
- data/rbi/sentdm/models/template_definition.rbi +20 -2
- data/rbi/sentdm/models/template_event.rbi +18 -10
- data/rbi/sentdm/models/template_event_payload.rbi +51 -8
- data/rbi/sentdm/models/template_list_params.rbi +22 -16
- data/rbi/sentdm/models/template_variable.rbi +28 -1
- data/rbi/sentdm/models/webhook_list_events_params.rbi +12 -6
- data/rbi/sentdm/models/webhook_list_events_response.rbi +120 -263
- data/rbi/sentdm/models/webhook_list_params.rbi +16 -10
- data/rbi/sentdm/models.rbi +8 -0
- data/rbi/sentdm/resources/contacts.rbi +6 -6
- data/rbi/sentdm/resources/conversations.rbi +14 -6
- data/rbi/sentdm/resources/templates.rbi +35 -9
- data/rbi/sentdm/resources/webhooks.rbi +12 -8
- data/sig/sentdm/internal/contacts_page.rbs +41 -0
- data/sig/sentdm/internal/conversations_page.rbs +41 -0
- data/sig/sentdm/internal/templates_page.rbs +44 -0
- data/sig/sentdm/internal/webhook_events_page.rbs +41 -0
- data/sig/sentdm/internal/webhooks_page.rbs +41 -0
- data/sig/sentdm/models/channel_event.rbs +44 -0
- data/sig/sentdm/models/channel_event_payload.rbs +63 -0
- data/sig/sentdm/models/contact_event.rbs +44 -0
- data/sig/sentdm/models/contact_event_payload.rbs +63 -0
- data/sig/sentdm/models/contact_list_params.rbs +11 -7
- data/sig/sentdm/models/conversation_list_messages_params.rbs +8 -4
- data/sig/sentdm/models/conversation_list_params.rbs +8 -4
- data/sig/sentdm/models/inbound_message_event.rbs +5 -0
- data/sig/sentdm/models/message_event.rbs +5 -0
- data/sig/sentdm/models/message_event_payload.rbs +5 -0
- data/sig/sentdm/models/template.rbs +5 -0
- data/sig/sentdm/models/template_event.rbs +5 -0
- data/sig/sentdm/models/template_event_payload.rbs +9 -6
- data/sig/sentdm/models/template_list_params.rbs +14 -10
- data/sig/sentdm/models/webhook_list_events_params.rbs +8 -4
- data/sig/sentdm/models/webhook_list_events_response.rbs +65 -127
- data/sig/sentdm/models/webhook_list_params.rbs +11 -7
- data/sig/sentdm/models.rbs +8 -0
- data/sig/sentdm/resources/contacts.rbs +3 -3
- data/sig/sentdm/resources/conversations.rbs +6 -6
- data/sig/sentdm/resources/templates.rbs +3 -3
- data/sig/sentdm/resources/webhooks.rbs +6 -6
- metadata +29 -11
- data/lib/sentdm/models/contact_list_response.rb +0 -65
- data/lib/sentdm/models/template_list_response.rb +0 -65
- data/lib/sentdm/models/webhook_list_response.rb +0 -65
- data/rbi/sentdm/models/contact_list_response.rbi +0 -128
- data/rbi/sentdm/models/template_list_response.rbi +0 -128
- data/rbi/sentdm/models/webhook_list_response.rbi +0 -128
- data/sig/sentdm/models/contact_list_response.rbs +0 -67
- data/sig/sentdm/models/template_list_response.rbs +0 -65
- data/sig/sentdm/models/webhook_list_response.rbs +0 -67
|
@@ -4,174 +4,122 @@ module Sentdm
|
|
|
4
4
|
module Models
|
|
5
5
|
# @see Sentdm::Resources::Webhooks#list_events
|
|
6
6
|
class WebhookListEventsResponse < Sentdm::Internal::Type::BaseModel
|
|
7
|
-
# @!attribute
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
# @
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
#
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
# @!method initialize(id: nil, created_at: nil, delivery_attempts: nil, delivery_status: nil, error_message: nil, event_data: nil, event_type: nil, http_status_code: nil, processing_completed_at: nil, processing_started_at: nil, response_body: nil)
|
|
125
|
-
# Some parameter documentations has been truncated, see
|
|
126
|
-
# {Sentdm::Models::WebhookListEventsResponse::Data::Event} for more details.
|
|
127
|
-
#
|
|
128
|
-
# @param id [String]
|
|
129
|
-
#
|
|
130
|
-
# @param created_at [Time]
|
|
131
|
-
#
|
|
132
|
-
# @param delivery_attempts [Integer]
|
|
133
|
-
#
|
|
134
|
-
# @param delivery_status [String]
|
|
135
|
-
#
|
|
136
|
-
# @param error_message [String, nil]
|
|
137
|
-
#
|
|
138
|
-
# @param event_data [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent] The exact event body that was delivered, or attempted, for this record. One of t
|
|
139
|
-
#
|
|
140
|
-
# @param event_type [String]
|
|
141
|
-
#
|
|
142
|
-
# @param http_status_code [Integer, nil]
|
|
143
|
-
#
|
|
144
|
-
# @param processing_completed_at [Time, nil]
|
|
145
|
-
#
|
|
146
|
-
# @param processing_started_at [Time, nil]
|
|
147
|
-
#
|
|
148
|
-
# @param response_body [String, nil]
|
|
149
|
-
|
|
150
|
-
# The exact event body that was delivered, or attempted, for this record. One of
|
|
151
|
-
# the three webhook envelopes: a message status change, an inbound message, or a
|
|
152
|
-
# template status change. Read field and event to tell which, the same way your
|
|
153
|
-
# endpoint does.
|
|
154
|
-
#
|
|
155
|
-
# @see Sentdm::Models::WebhookListEventsResponse::Data::Event#event_data
|
|
156
|
-
module EventData
|
|
157
|
-
extend Sentdm::Internal::Type::Union
|
|
158
|
-
|
|
159
|
-
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
160
|
-
# varies only in Payload.
|
|
161
|
-
variant -> { Sentdm::MessageEvent }
|
|
162
|
-
|
|
163
|
-
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
164
|
-
# varies only in Payload.
|
|
165
|
-
variant -> { Sentdm::InboundMessageEvent }
|
|
166
|
-
|
|
167
|
-
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
168
|
-
# varies only in Payload.
|
|
169
|
-
variant -> { Sentdm::TemplateEvent }
|
|
170
|
-
|
|
171
|
-
# @!method self.variants
|
|
172
|
-
# @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent)]
|
|
173
|
-
end
|
|
174
|
-
end
|
|
7
|
+
# @!attribute id
|
|
8
|
+
#
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
optional :id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute created_at
|
|
13
|
+
#
|
|
14
|
+
# @return [Time, nil]
|
|
15
|
+
optional :created_at, Time
|
|
16
|
+
|
|
17
|
+
# @!attribute delivery_attempts
|
|
18
|
+
#
|
|
19
|
+
# @return [Integer, nil]
|
|
20
|
+
optional :delivery_attempts, Integer
|
|
21
|
+
|
|
22
|
+
# @!attribute delivery_status
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
optional :delivery_status, String
|
|
26
|
+
|
|
27
|
+
# @!attribute error_message
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :error_message, String, nil?: true
|
|
31
|
+
|
|
32
|
+
# @!attribute event_data
|
|
33
|
+
# The exact event body that was delivered, or attempted, for this record. One of
|
|
34
|
+
# the four webhook envelopes: a message status change, an inbound message, a
|
|
35
|
+
# template status change, or a contact consent signal. Read field and event to
|
|
36
|
+
# tell which, the same way your endpoint does.
|
|
37
|
+
#
|
|
38
|
+
# @return [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent, nil]
|
|
39
|
+
optional :event_data, union: -> { Sentdm::Models::WebhookListEventsResponse::EventData }
|
|
40
|
+
|
|
41
|
+
# @!attribute event_type
|
|
42
|
+
#
|
|
43
|
+
# @return [String, nil]
|
|
44
|
+
optional :event_type, String
|
|
45
|
+
|
|
46
|
+
# @!attribute http_status_code
|
|
47
|
+
#
|
|
48
|
+
# @return [Integer, nil]
|
|
49
|
+
optional :http_status_code, Integer, nil?: true
|
|
50
|
+
|
|
51
|
+
# @!attribute processing_completed_at
|
|
52
|
+
#
|
|
53
|
+
# @return [Time, nil]
|
|
54
|
+
optional :processing_completed_at, Time, nil?: true
|
|
55
|
+
|
|
56
|
+
# @!attribute processing_started_at
|
|
57
|
+
#
|
|
58
|
+
# @return [Time, nil]
|
|
59
|
+
optional :processing_started_at, Time, nil?: true
|
|
60
|
+
|
|
61
|
+
# @!attribute response_body
|
|
62
|
+
#
|
|
63
|
+
# @return [String, nil]
|
|
64
|
+
optional :response_body, String, nil?: true
|
|
65
|
+
|
|
66
|
+
# @!method initialize(id: nil, created_at: nil, delivery_attempts: nil, delivery_status: nil, error_message: nil, event_data: nil, event_type: nil, http_status_code: nil, processing_completed_at: nil, processing_started_at: nil, response_body: nil)
|
|
67
|
+
# Some parameter documentations has been truncated, see
|
|
68
|
+
# {Sentdm::Models::WebhookListEventsResponse} for more details.
|
|
69
|
+
#
|
|
70
|
+
# @param id [String]
|
|
71
|
+
#
|
|
72
|
+
# @param created_at [Time]
|
|
73
|
+
#
|
|
74
|
+
# @param delivery_attempts [Integer]
|
|
75
|
+
#
|
|
76
|
+
# @param delivery_status [String]
|
|
77
|
+
#
|
|
78
|
+
# @param error_message [String, nil]
|
|
79
|
+
#
|
|
80
|
+
# @param event_data [Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent] The exact event body that was delivered, or attempted, for this record. One of t
|
|
81
|
+
#
|
|
82
|
+
# @param event_type [String]
|
|
83
|
+
#
|
|
84
|
+
# @param http_status_code [Integer, nil]
|
|
85
|
+
#
|
|
86
|
+
# @param processing_completed_at [Time, nil]
|
|
87
|
+
#
|
|
88
|
+
# @param processing_started_at [Time, nil]
|
|
89
|
+
#
|
|
90
|
+
# @param response_body [String, nil]
|
|
91
|
+
|
|
92
|
+
# The exact event body that was delivered, or attempted, for this record. One of
|
|
93
|
+
# the four webhook envelopes: a message status change, an inbound message, a
|
|
94
|
+
# template status change, or a contact consent signal. Read field and event to
|
|
95
|
+
# tell which, the same way your endpoint does.
|
|
96
|
+
#
|
|
97
|
+
# @see Sentdm::Models::WebhookListEventsResponse#event_data
|
|
98
|
+
module EventData
|
|
99
|
+
extend Sentdm::Internal::Type::Union
|
|
100
|
+
|
|
101
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
102
|
+
# varies only in Payload.
|
|
103
|
+
variant -> { Sentdm::MessageEvent }
|
|
104
|
+
|
|
105
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
106
|
+
# varies only in Payload.
|
|
107
|
+
variant -> { Sentdm::InboundMessageEvent }
|
|
108
|
+
|
|
109
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
110
|
+
# varies only in Payload.
|
|
111
|
+
variant -> { Sentdm::TemplateEvent }
|
|
112
|
+
|
|
113
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
114
|
+
# varies only in Payload.
|
|
115
|
+
variant -> { Sentdm::ChannelEvent }
|
|
116
|
+
|
|
117
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares this shape and
|
|
118
|
+
# varies only in Payload.
|
|
119
|
+
variant -> { Sentdm::ContactEvent }
|
|
120
|
+
|
|
121
|
+
# @!method self.variants
|
|
122
|
+
# @return [Array(Sentdm::Models::MessageEvent, Sentdm::Models::InboundMessageEvent, Sentdm::Models::TemplateEvent, Sentdm::Models::ChannelEvent, Sentdm::Models::ContactEvent)]
|
|
175
123
|
end
|
|
176
124
|
end
|
|
177
125
|
end
|
|
@@ -7,20 +7,20 @@ module Sentdm
|
|
|
7
7
|
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Sentdm::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!attribute
|
|
10
|
+
# @!attribute is_active
|
|
11
11
|
#
|
|
12
|
-
# @return [
|
|
13
|
-
|
|
12
|
+
# @return [Boolean, nil]
|
|
13
|
+
optional :is_active, Sentdm::Internal::Type::Boolean, nil?: true
|
|
14
14
|
|
|
15
|
-
# @!attribute
|
|
15
|
+
# @!attribute page
|
|
16
16
|
#
|
|
17
|
-
# @return [Integer]
|
|
18
|
-
|
|
17
|
+
# @return [Integer, nil]
|
|
18
|
+
optional :page, Integer
|
|
19
19
|
|
|
20
|
-
# @!attribute
|
|
20
|
+
# @!attribute page_size
|
|
21
21
|
#
|
|
22
|
-
# @return [
|
|
23
|
-
optional :
|
|
22
|
+
# @return [Integer, nil]
|
|
23
|
+
optional :page_size, Integer
|
|
24
24
|
|
|
25
25
|
# @!attribute search
|
|
26
26
|
#
|
|
@@ -32,10 +32,10 @@ module Sentdm
|
|
|
32
32
|
# @return [String, nil]
|
|
33
33
|
optional :x_profile_id, String
|
|
34
34
|
|
|
35
|
-
# @!method initialize(page
|
|
35
|
+
# @!method initialize(is_active: nil, page: nil, page_size: nil, search: nil, x_profile_id: nil, request_options: {})
|
|
36
|
+
# @param is_active [Boolean, nil]
|
|
36
37
|
# @param page [Integer]
|
|
37
38
|
# @param page_size [Integer]
|
|
38
|
-
# @param is_active [Boolean, nil]
|
|
39
39
|
# @param search [String, nil]
|
|
40
40
|
# @param x_profile_id [String]
|
|
41
41
|
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
data/lib/sentdm/models.rb
CHANGED
|
@@ -67,10 +67,18 @@ module Sentdm
|
|
|
67
67
|
|
|
68
68
|
BrandsBrandData = Sentdm::Models::BrandsBrandData
|
|
69
69
|
|
|
70
|
+
ChannelEvent = Sentdm::Models::ChannelEvent
|
|
71
|
+
|
|
72
|
+
ChannelEventPayload = Sentdm::Models::ChannelEventPayload
|
|
73
|
+
|
|
70
74
|
ContactCreateParams = Sentdm::Models::ContactCreateParams
|
|
71
75
|
|
|
72
76
|
ContactDeleteParams = Sentdm::Models::ContactDeleteParams
|
|
73
77
|
|
|
78
|
+
ContactEvent = Sentdm::Models::ContactEvent
|
|
79
|
+
|
|
80
|
+
ContactEventPayload = Sentdm::Models::ContactEventPayload
|
|
81
|
+
|
|
74
82
|
ContactListParams = Sentdm::Models::ContactListParams
|
|
75
83
|
|
|
76
84
|
ContactMessageSummary = Sentdm::Models::ContactMessageSummary
|
|
@@ -118,14 +118,14 @@ module Sentdm
|
|
|
118
118
|
# Retrieves a paginated list of contacts for the authenticated customer. Supports
|
|
119
119
|
# filtering by search term, channel, or phone number.
|
|
120
120
|
#
|
|
121
|
-
# @overload list(page
|
|
121
|
+
# @overload list(channel: nil, page: nil, page_size: nil, phone: nil, search: nil, x_profile_id: nil, request_options: {})
|
|
122
|
+
#
|
|
123
|
+
# @param channel [String, nil] Query param: Optional channel filter (sms, whatsapp)
|
|
122
124
|
#
|
|
123
125
|
# @param page [Integer] Query param: Page number (1-indexed)
|
|
124
126
|
#
|
|
125
127
|
# @param page_size [Integer] Query param: Number of items per page
|
|
126
128
|
#
|
|
127
|
-
# @param channel [String, nil] Query param: Optional channel filter (sms, whatsapp)
|
|
128
|
-
#
|
|
129
129
|
# @param phone [String, nil] Query param: Optional phone number filter (alternative to list view)
|
|
130
130
|
#
|
|
131
131
|
# @param search [String, nil] Query param: Optional search term for filtering contacts
|
|
@@ -134,11 +134,11 @@ module Sentdm
|
|
|
134
134
|
#
|
|
135
135
|
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
136
136
|
#
|
|
137
|
-
# @return [Sentdm::Models::
|
|
137
|
+
# @return [Sentdm::Internal::ContactsPage<Sentdm::Models::ContactResponse>]
|
|
138
138
|
#
|
|
139
139
|
# @see Sentdm::Models::ContactListParams
|
|
140
|
-
def list(params)
|
|
141
|
-
query_params = [:
|
|
140
|
+
def list(params = {})
|
|
141
|
+
query_params = [:channel, :page, :page_size, :phone, :search]
|
|
142
142
|
parsed, options = Sentdm::ContactListParams.dump_request(params)
|
|
143
143
|
query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
144
144
|
@client.request(
|
|
@@ -146,7 +146,8 @@ module Sentdm
|
|
|
146
146
|
path: "v3/contacts",
|
|
147
147
|
query: query,
|
|
148
148
|
headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
|
|
149
|
-
|
|
149
|
+
page: Sentdm::Internal::ContactsPage,
|
|
150
|
+
model: Sentdm::ContactResponse,
|
|
150
151
|
options: options
|
|
151
152
|
)
|
|
152
153
|
end
|
|
@@ -17,7 +17,7 @@ module Sentdm
|
|
|
17
17
|
# Retrieves a paginated list of the authenticated customer's messages across all
|
|
18
18
|
# conversations, ordered by created date (most recent first).
|
|
19
19
|
#
|
|
20
|
-
# @overload list(page
|
|
20
|
+
# @overload list(page: nil, page_size: nil, x_profile_id: nil, request_options: {})
|
|
21
21
|
#
|
|
22
22
|
# @param page [Integer] Query param
|
|
23
23
|
#
|
|
@@ -27,10 +27,10 @@ module Sentdm
|
|
|
27
27
|
#
|
|
28
28
|
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
29
29
|
#
|
|
30
|
-
# @return [Sentdm::Models::
|
|
30
|
+
# @return [Sentdm::Internal::ConversationsPage<Sentdm::Models::ConversationMessagesList::Message>]
|
|
31
31
|
#
|
|
32
32
|
# @see Sentdm::Models::ConversationListParams
|
|
33
|
-
def list(params)
|
|
33
|
+
def list(params = {})
|
|
34
34
|
query_params = [:page, :page_size]
|
|
35
35
|
parsed, options = Sentdm::ConversationListParams.dump_request(params)
|
|
36
36
|
query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
@@ -39,7 +39,8 @@ module Sentdm
|
|
|
39
39
|
path: "v3/conversations",
|
|
40
40
|
query: query,
|
|
41
41
|
headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
|
|
42
|
-
|
|
42
|
+
page: Sentdm::Internal::ConversationsPage,
|
|
43
|
+
model: Sentdm::ConversationMessagesList::Message,
|
|
43
44
|
options: options
|
|
44
45
|
)
|
|
45
46
|
end
|
|
@@ -50,7 +51,7 @@ module Sentdm
|
|
|
50
51
|
# Retrieves a paginated list of the messages in a single conversation (scoped to
|
|
51
52
|
# the authenticated customer), ordered by created date (most recent first).
|
|
52
53
|
#
|
|
53
|
-
# @overload list_messages(id, page
|
|
54
|
+
# @overload list_messages(id, page: nil, page_size: nil, x_profile_id: nil, request_options: {})
|
|
54
55
|
#
|
|
55
56
|
# @param id [String] Path param: Conversation id from the route.
|
|
56
57
|
#
|
|
@@ -62,10 +63,10 @@ module Sentdm
|
|
|
62
63
|
#
|
|
63
64
|
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
64
65
|
#
|
|
65
|
-
# @return [Sentdm::Models::
|
|
66
|
+
# @return [Sentdm::Internal::ConversationsPage<Sentdm::Models::ConversationMessagesList::Message>]
|
|
66
67
|
#
|
|
67
68
|
# @see Sentdm::Models::ConversationListMessagesParams
|
|
68
|
-
def list_messages(id, params)
|
|
69
|
+
def list_messages(id, params = {})
|
|
69
70
|
query_params = [:page, :page_size]
|
|
70
71
|
parsed, options = Sentdm::ConversationListMessagesParams.dump_request(params)
|
|
71
72
|
query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
@@ -74,7 +75,8 @@ module Sentdm
|
|
|
74
75
|
path: ["v3/conversations/%1$s", id],
|
|
75
76
|
query: query,
|
|
76
77
|
headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
|
|
77
|
-
|
|
78
|
+
page: Sentdm::Internal::ConversationsPage,
|
|
79
|
+
model: Sentdm::ConversationMessagesList::Message,
|
|
78
80
|
options: options
|
|
79
81
|
)
|
|
80
82
|
end
|
|
@@ -15,7 +15,9 @@ module Sentdm
|
|
|
15
15
|
#
|
|
16
16
|
# Creates a new message template with header, body, footer, and buttons. The
|
|
17
17
|
# template can be submitted for review immediately or saved as draft for later
|
|
18
|
-
# submission.
|
|
18
|
+
# submission. There is no `name` field on create — the display name is derived
|
|
19
|
+
# from the template's content and can be changed afterwards with
|
|
20
|
+
# `PUT /v3/templates/{id}`.
|
|
19
21
|
#
|
|
20
22
|
# @overload create(category: nil, creation_source: nil, definition: nil, language: nil, sandbox: nil, submit_for_review: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
21
23
|
#
|
|
@@ -85,7 +87,31 @@ module Sentdm
|
|
|
85
87
|
# {Sentdm::Models::TemplateUpdateParams} for more details.
|
|
86
88
|
#
|
|
87
89
|
# Updates an existing template's name, category, language, definition, or submits
|
|
88
|
-
# it for review.
|
|
90
|
+
# it for review. While the template is in review (status PENDING, or any channel
|
|
91
|
+
# awaiting a verdict) its definition, category and language are frozen and a
|
|
92
|
+
# resubmission is refused — those requests answer 409 CONFLICT_006. The display
|
|
93
|
+
# name stays editable throughout.
|
|
94
|
+
#
|
|
95
|
+
# `definition`, `category` and `language` are editable only from status DRAFT,
|
|
96
|
+
# REJECTED or APPROVED. An edit to any of them on a template in another state
|
|
97
|
+
# (PAUSED, DISABLED or REVOKED) is refused with 400 VALIDATION_001 and the detail
|
|
98
|
+
# "Template (except display name) cannot be updated unless it is in draft or
|
|
99
|
+
# rejected status"; `name` stays editable in every state. `submit_for_review` on a
|
|
100
|
+
# PAUSED, DISABLED or REVOKED template is accepted and answers 200, but opens no
|
|
101
|
+
# review and does not move the status — only the reviewer can reinstate it.
|
|
102
|
+
#
|
|
103
|
+
# Editing an APPROVED template is a live edit: the new content is stored
|
|
104
|
+
# immediately, and sending `submit_for_review: true` re-opens review, which
|
|
105
|
+
# returns the affected channels to PENDING so they stop sending until they are
|
|
106
|
+
# approved again. The previously approved content is never sent during re-review.
|
|
107
|
+
# Watch the per-channel `templates` webhook events rather than assuming the
|
|
108
|
+
# template-level status.
|
|
109
|
+
#
|
|
110
|
+
# Templates provisioned by Sent (light-onboarding templates, whose names carry the
|
|
111
|
+
# reserved `sent_` prefix) are read-only: every field is refused with 400
|
|
112
|
+
# VALIDATION*001 and the detail "This template is read-only. Only 'submit for
|
|
113
|
+
# review' is allowed.", and only `submit_for_review` is accepted. A `name`
|
|
114
|
+
# starting with `sent*` is refused for the same reason — the prefix is reserved.
|
|
89
115
|
#
|
|
90
116
|
# @overload update(id, category: nil, definition: nil, language: nil, name: nil, sandbox: nil, submit_for_review: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
91
117
|
#
|
|
@@ -131,16 +157,16 @@ module Sentdm
|
|
|
131
157
|
# Retrieves a paginated list of message templates for the authenticated customer.
|
|
132
158
|
# Supports filtering by status, category, and search term.
|
|
133
159
|
#
|
|
134
|
-
# @overload list(
|
|
135
|
-
#
|
|
136
|
-
# @param page [Integer] Query param: Page number (1-indexed)
|
|
137
|
-
#
|
|
138
|
-
# @param page_size [Integer] Query param: Number of items per page
|
|
160
|
+
# @overload list(category: nil, is_welcome_playground: nil, page: nil, page_size: nil, search: nil, status: nil, x_profile_id: nil, request_options: {})
|
|
139
161
|
#
|
|
140
162
|
# @param category [String, nil] Query param: Optional category filter: MARKETING, UTILITY, AUTHENTICATION
|
|
141
163
|
#
|
|
142
164
|
# @param is_welcome_playground [Boolean, nil] Query param: Accepted and ignored. It used to filter on the welcome-playground m
|
|
143
165
|
#
|
|
166
|
+
# @param page [Integer] Query param: Page number (1-indexed)
|
|
167
|
+
#
|
|
168
|
+
# @param page_size [Integer] Query param: Number of items per page
|
|
169
|
+
#
|
|
144
170
|
# @param search [String, nil] Query param: Optional search term for filtering templates
|
|
145
171
|
#
|
|
146
172
|
# @param status [String, nil] Query param: Optional status filter: APPROVED, PENDING, REJECTED
|
|
@@ -149,11 +175,11 @@ module Sentdm
|
|
|
149
175
|
#
|
|
150
176
|
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
151
177
|
#
|
|
152
|
-
# @return [Sentdm::Models::
|
|
178
|
+
# @return [Sentdm::Internal::TemplatesPage<Sentdm::Models::Template>]
|
|
153
179
|
#
|
|
154
180
|
# @see Sentdm::Models::TemplateListParams
|
|
155
|
-
def list(params)
|
|
156
|
-
query_params = [:
|
|
181
|
+
def list(params = {})
|
|
182
|
+
query_params = [:category, :is_welcome_playground, :page, :page_size, :search, :status]
|
|
157
183
|
parsed, options = Sentdm::TemplateListParams.dump_request(params)
|
|
158
184
|
query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
159
185
|
@client.request(
|
|
@@ -161,7 +187,8 @@ module Sentdm
|
|
|
161
187
|
path: "v3/templates",
|
|
162
188
|
query: query,
|
|
163
189
|
headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
|
|
164
|
-
|
|
190
|
+
page: Sentdm::Internal::TemplatesPage,
|
|
191
|
+
model: Sentdm::Template,
|
|
165
192
|
options: options
|
|
166
193
|
)
|
|
167
194
|
end
|
|
@@ -134,25 +134,25 @@ module Sentdm
|
|
|
134
134
|
#
|
|
135
135
|
# Retrieves a paginated list of webhooks for the authenticated customer.
|
|
136
136
|
#
|
|
137
|
-
# @overload list(page
|
|
137
|
+
# @overload list(is_active: nil, page: nil, page_size: nil, search: nil, x_profile_id: nil, request_options: {})
|
|
138
|
+
#
|
|
139
|
+
# @param is_active [Boolean, nil] Query param
|
|
138
140
|
#
|
|
139
141
|
# @param page [Integer] Query param
|
|
140
142
|
#
|
|
141
143
|
# @param page_size [Integer] Query param
|
|
142
144
|
#
|
|
143
|
-
# @param is_active [Boolean, nil] Query param
|
|
144
|
-
#
|
|
145
145
|
# @param search [String, nil] Query param
|
|
146
146
|
#
|
|
147
147
|
# @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
|
|
148
148
|
#
|
|
149
149
|
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
150
150
|
#
|
|
151
|
-
# @return [Sentdm::Models::
|
|
151
|
+
# @return [Sentdm::Internal::WebhooksPage<Sentdm::Models::WebhookResponse>]
|
|
152
152
|
#
|
|
153
153
|
# @see Sentdm::Models::WebhookListParams
|
|
154
|
-
def list(params)
|
|
155
|
-
query_params = [:
|
|
154
|
+
def list(params = {})
|
|
155
|
+
query_params = [:is_active, :page, :page_size, :search]
|
|
156
156
|
parsed, options = Sentdm::WebhookListParams.dump_request(params)
|
|
157
157
|
query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
158
158
|
@client.request(
|
|
@@ -160,7 +160,8 @@ module Sentdm
|
|
|
160
160
|
path: "v3/webhooks",
|
|
161
161
|
query: query,
|
|
162
162
|
headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
|
|
163
|
-
|
|
163
|
+
page: Sentdm::Internal::WebhooksPage,
|
|
164
|
+
model: Sentdm::WebhookResponse,
|
|
164
165
|
options: options
|
|
165
166
|
)
|
|
166
167
|
end
|
|
@@ -222,7 +223,7 @@ module Sentdm
|
|
|
222
223
|
#
|
|
223
224
|
# Retrieves a paginated list of delivery events for the specified webhook.
|
|
224
225
|
#
|
|
225
|
-
# @overload list_events(id, page
|
|
226
|
+
# @overload list_events(id, page: nil, page_size: nil, search: nil, x_profile_id: nil, request_options: {})
|
|
226
227
|
#
|
|
227
228
|
# @param id [String] Path param
|
|
228
229
|
#
|
|
@@ -236,10 +237,10 @@ module Sentdm
|
|
|
236
237
|
#
|
|
237
238
|
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
238
239
|
#
|
|
239
|
-
# @return [Sentdm::Models::WebhookListEventsResponse]
|
|
240
|
+
# @return [Sentdm::Internal::WebhookEventsPage<Sentdm::Models::WebhookListEventsResponse>]
|
|
240
241
|
#
|
|
241
242
|
# @see Sentdm::Models::WebhookListEventsParams
|
|
242
|
-
def list_events(id, params)
|
|
243
|
+
def list_events(id, params = {})
|
|
243
244
|
query_params = [:page, :page_size, :search]
|
|
244
245
|
parsed, options = Sentdm::WebhookListEventsParams.dump_request(params)
|
|
245
246
|
query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
@@ -248,6 +249,7 @@ module Sentdm
|
|
|
248
249
|
path: ["v3/webhooks/%1$s/events", id],
|
|
249
250
|
query: query,
|
|
250
251
|
headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
|
|
252
|
+
page: Sentdm::Internal::WebhookEventsPage,
|
|
251
253
|
model: Sentdm::Models::WebhookListEventsResponse,
|
|
252
254
|
options: options
|
|
253
255
|
)
|
data/lib/sentdm/version.rb
CHANGED