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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Sentdm
|
|
4
4
|
module Models
|
|
5
|
+
# @see Sentdm::Resources::Templates#list
|
|
5
6
|
class Template < Sentdm::Internal::Type::BaseModel
|
|
6
7
|
# @!attribute customer_id
|
|
7
8
|
# Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
@@ -16,6 +17,23 @@ module Sentdm
|
|
|
16
17
|
# @return [String, nil]
|
|
17
18
|
optional :id, String
|
|
18
19
|
|
|
20
|
+
# @!attribute auto_reply_action
|
|
21
|
+
# Which consent keyword this template answers, when it is one of Sent's
|
|
22
|
+
# auto-replies: OPT_IN, OPT_OUT, HELP, or OTHER for a customer-defined keyword.
|
|
23
|
+
# Null for an ordinary template, and omitted from the response, so its presence is
|
|
24
|
+
# the answer to "is this an auto-reply".
|
|
25
|
+
#
|
|
26
|
+
# Deliberately not required, unlike CustomerId, even though the same "no single
|
|
27
|
+
# mapper" argument applies: NJsonSchema publishes a C# required member in the
|
|
28
|
+
# schema's required array, so the contract would have advertised a field this
|
|
29
|
+
# response omits for every ordinary template, and a generated client could refuse
|
|
30
|
+
# the common case. A compile-time guard is not worth a wrong published contract.
|
|
31
|
+
# Every mapping site sets it explicitly, and TemplateResponseSchemaTests pins the
|
|
32
|
+
# field as optional so it cannot be reintroduced.
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :auto_reply_action, String, nil?: true
|
|
36
|
+
|
|
19
37
|
# @!attribute category
|
|
20
38
|
# Template category: MARKETING, UTILITY, AUTHENTICATION
|
|
21
39
|
#
|
|
@@ -23,7 +41,18 @@ module Sentdm
|
|
|
23
41
|
optional :category, String
|
|
24
42
|
|
|
25
43
|
# @!attribute channels
|
|
26
|
-
#
|
|
44
|
+
# The channels this template's definition can render on, in canonical order: sms,
|
|
45
|
+
# whatsapp, rcs.
|
|
46
|
+
#
|
|
47
|
+
# Derived from the definition's body, mirroring each channel's send-time fallback
|
|
48
|
+
# chain, so a channel is listed only when a real body would be produced for it:
|
|
49
|
+
# SMS reads sms ?? multiChannel, WhatsApp reads whatsapp ?? multiChannel, and RCS
|
|
50
|
+
# reads rcs ?? multiChannel ?? sms. A multiChannel body therefore reports all
|
|
51
|
+
# three, and the extra SMS fallback on RCS is why an sms/whatsapp pair reports RCS
|
|
52
|
+
# too.
|
|
53
|
+
#
|
|
54
|
+
# This says what the content can render on, not what may be sent: sending also
|
|
55
|
+
# needs the template approved for that channel.
|
|
27
56
|
#
|
|
28
57
|
# @return [Array<String>, nil]
|
|
29
58
|
optional :channels, Sentdm::Internal::Type::ArrayOf[String], nil?: true
|
|
@@ -53,7 +82,8 @@ module Sentdm
|
|
|
53
82
|
optional :name, String
|
|
54
83
|
|
|
55
84
|
# @!attribute status
|
|
56
|
-
# Template status:
|
|
85
|
+
# Template status: DRAFT, PENDING, APPROVED, REJECTED. A template created with
|
|
86
|
+
# submit_for_review: false starts as DRAFT and stays there until it is submitted.
|
|
57
87
|
#
|
|
58
88
|
# @return [String, nil]
|
|
59
89
|
optional :status, String
|
|
@@ -70,7 +100,7 @@ module Sentdm
|
|
|
70
100
|
# @return [Array<String>, nil]
|
|
71
101
|
optional :variables, Sentdm::Internal::Type::ArrayOf[String], nil?: true
|
|
72
102
|
|
|
73
|
-
# @!method initialize(customer_id:, id: nil, category: nil, channels: nil, created_at: nil, is_published: nil, language: nil, name: nil, status: nil, updated_at: nil, variables: nil)
|
|
103
|
+
# @!method initialize(customer_id:, id: nil, auto_reply_action: nil, category: nil, channels: nil, created_at: nil, is_published: nil, language: nil, name: nil, status: nil, updated_at: nil, variables: nil)
|
|
74
104
|
# Some parameter documentations has been truncated, see {Sentdm::Models::Template}
|
|
75
105
|
# for more details.
|
|
76
106
|
#
|
|
@@ -80,9 +110,11 @@ module Sentdm
|
|
|
80
110
|
#
|
|
81
111
|
# @param id [String] Unique template identifier
|
|
82
112
|
#
|
|
113
|
+
# @param auto_reply_action [String, nil] Which consent keyword this template answers, when it is one of Sent's auto-repli
|
|
114
|
+
#
|
|
83
115
|
# @param category [String] Template category: MARKETING, UTILITY, AUTHENTICATION
|
|
84
116
|
#
|
|
85
|
-
# @param channels [Array<String>, nil]
|
|
117
|
+
# @param channels [Array<String>, nil] The channels this template's definition can render on, in canonical order: sms,
|
|
86
118
|
#
|
|
87
119
|
# @param created_at [Time] When the template was created
|
|
88
120
|
#
|
|
@@ -92,7 +124,7 @@ module Sentdm
|
|
|
92
124
|
#
|
|
93
125
|
# @param name [String] Template display name
|
|
94
126
|
#
|
|
95
|
-
# @param status [String] Template status:
|
|
127
|
+
# @param status [String] Template status: DRAFT, PENDING, APPROVED, REJECTED. A template created with
|
|
96
128
|
#
|
|
97
129
|
# @param updated_at [Time, nil] When the template was last updated
|
|
98
130
|
#
|
|
@@ -4,27 +4,27 @@ module Sentdm
|
|
|
4
4
|
module Models
|
|
5
5
|
class TemplateBody < Sentdm::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute multi_channel
|
|
7
|
-
#
|
|
8
|
-
# channel-specific content is provided
|
|
7
|
+
# The shared body, used for every channel. One half of the choice described above.
|
|
9
8
|
#
|
|
10
9
|
# @return [Sentdm::Models::TemplateBodyContent, nil]
|
|
11
10
|
optional :multi_channel, -> { Sentdm::TemplateBodyContent }, api_name: :multiChannel, nil?: true
|
|
12
11
|
|
|
13
12
|
# @!attribute rcs
|
|
14
|
-
# RCS-specific
|
|
13
|
+
# RCS-specific copy that overrides the chosen strategy for RCS only. The one true
|
|
14
|
+
# override: optional on top of either strategy, but it cannot be the only body
|
|
15
|
+
# present. Its length cap is the higher one described on Template.
|
|
15
16
|
#
|
|
16
17
|
# @return [Sentdm::Models::TemplateBodyContent, nil]
|
|
17
18
|
optional :rcs, -> { Sentdm::TemplateBodyContent }, nil?: true
|
|
18
19
|
|
|
19
20
|
# @!attribute sms
|
|
20
|
-
# SMS
|
|
21
|
+
# The SMS body. It does not override multiChannel, it replaces it.
|
|
21
22
|
#
|
|
22
23
|
# @return [Sentdm::Models::TemplateBodyContent, nil]
|
|
23
24
|
optional :sms, -> { Sentdm::TemplateBodyContent }, nil?: true
|
|
24
25
|
|
|
25
26
|
# @!attribute whatsapp
|
|
26
|
-
# WhatsApp
|
|
27
|
-
# messages
|
|
27
|
+
# The WhatsApp body. It does not override multiChannel, it replaces it.
|
|
28
28
|
#
|
|
29
29
|
# @return [Sentdm::Models::TemplateBodyContent, nil]
|
|
30
30
|
optional :whatsapp, -> { Sentdm::TemplateBodyContent }, nil?: true
|
|
@@ -33,15 +33,24 @@ module Sentdm
|
|
|
33
33
|
# Some parameter documentations has been truncated, see
|
|
34
34
|
# {Sentdm::Models::TemplateBody} for more details.
|
|
35
35
|
#
|
|
36
|
-
# Body section of a message template
|
|
36
|
+
# Body section of a message template.
|
|
37
37
|
#
|
|
38
|
-
#
|
|
38
|
+
# A body picks one of two authoring strategies, and mixing them is refused
|
|
39
|
+
# (TemplateDefinitionValidator.HaveValidChannelConfiguration): a shared
|
|
40
|
+
# multiChannel body on its own, or an explicit sms + whatsapp pair, both present.
|
|
39
41
|
#
|
|
40
|
-
#
|
|
42
|
+
# multiChannel together with sms or whatsapp is rejected, and so is sms or
|
|
43
|
+
# whatsapp on its own — every template is expected to be deliverable on every
|
|
44
|
+
# channel. rcs is the one true override: it may accompany either strategy to vary
|
|
45
|
+
# the copy, but cannot stand alone.
|
|
41
46
|
#
|
|
42
|
-
# @param
|
|
47
|
+
# @param multi_channel [Sentdm::Models::TemplateBodyContent, nil] The shared body, used for every channel. One half of the choice described above.
|
|
43
48
|
#
|
|
44
|
-
# @param
|
|
49
|
+
# @param rcs [Sentdm::Models::TemplateBodyContent, nil] RCS-specific copy that overrides the chosen strategy for RCS only. The one true
|
|
50
|
+
#
|
|
51
|
+
# @param sms [Sentdm::Models::TemplateBodyContent, nil] The SMS body. It does not override multiChannel, it replaces it.
|
|
52
|
+
#
|
|
53
|
+
# @param whatsapp [Sentdm::Models::TemplateBodyContent, nil] The WhatsApp body. It does not override multiChannel, it replaces it.
|
|
45
54
|
end
|
|
46
55
|
end
|
|
47
56
|
end
|
|
@@ -4,24 +4,56 @@ module Sentdm
|
|
|
4
4
|
module Models
|
|
5
5
|
class TemplateBodyContent < Sentdm::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute template
|
|
7
|
+
# The body copy, with variables written as {{index:variable}}.
|
|
8
|
+
#
|
|
9
|
+
# Length cap depends on which channel this body belongs to:
|
|
10
|
+
# TemplateContentLimits.MaxBodyLength (1024) for multiChannel, sms and whatsapp —
|
|
11
|
+
# Meta's BODY limit, which a multiChannel body may be delivered under — and
|
|
12
|
+
# TemplateContentLimits.MaxRcsBodyLength (3072) for an rcs body, which never
|
|
13
|
+
# reaches Meta. The maxLength advertised on this schema is the 1024 one, because
|
|
14
|
+
# all four channel bodies share this single schema — an rcs body between the two
|
|
15
|
+
# is accepted.
|
|
16
|
+
#
|
|
17
|
+
# Meta requires every variable to carry surrounding context, so a body is refused
|
|
18
|
+
# unless it also satisfies all of the following (enforced by
|
|
19
|
+
# TemplateDefinitionValidator): At least one letter before the first variable and
|
|
20
|
+
# after the last — trailing punctuation such as "... {{1:variable}}." does not
|
|
21
|
+
# count. At least (2 × variable count) + 1 words once the placeholders are
|
|
22
|
+
# removed. No two variables adjacent with only whitespace between them. No leading
|
|
23
|
+
# or trailing newline, no more than two consecutive line breaks, and no more than
|
|
24
|
+
# four consecutive spaces.
|
|
25
|
+
#
|
|
26
|
+
# Example: "Hello {{0:variable}}! Welcome to {{1:variable}}. We are glad to have
|
|
27
|
+
# you on board." — two variables, so at least five words are required, and the
|
|
28
|
+
# copy after the final variable contains letters.
|
|
7
29
|
#
|
|
8
30
|
# @return [String]
|
|
9
31
|
required :template, String
|
|
10
32
|
|
|
11
33
|
# @!attribute type
|
|
34
|
+
# The type of body content — send "text". It is dropped from the stored definition
|
|
35
|
+
# when null, so a body posted without it is saved with no type key at all and the
|
|
36
|
+
# template editor has nothing to render the block from.
|
|
12
37
|
#
|
|
13
38
|
# @return [String, nil]
|
|
14
39
|
optional :type, String, nil?: true
|
|
15
40
|
|
|
16
41
|
# @!attribute variables
|
|
42
|
+
# The variables referenced by the body copy, one entry per {{index:variable}}
|
|
43
|
+
# placeholder.
|
|
17
44
|
#
|
|
18
45
|
# @return [Array<Sentdm::Models::TemplateVariable>, nil]
|
|
19
46
|
optional :variables, -> { Sentdm::Internal::Type::ArrayOf[Sentdm::TemplateVariable] }, nil?: true
|
|
20
47
|
|
|
21
48
|
# @!method initialize(template:, type: nil, variables: nil)
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
49
|
+
# Some parameter documentations has been truncated, see
|
|
50
|
+
# {Sentdm::Models::TemplateBodyContent} for more details.
|
|
51
|
+
#
|
|
52
|
+
# @param template [String] The body copy, with variables written as {{index:variable}}.
|
|
53
|
+
#
|
|
54
|
+
# @param type [String, nil] The type of body content — send "text". It is dropped from the stored definition
|
|
55
|
+
#
|
|
56
|
+
# @param variables [Array<Sentdm::Models::TemplateVariable>, nil] The variables referenced by the body copy, one entry per {{index:variable}} plac
|
|
25
57
|
end
|
|
26
58
|
end
|
|
27
59
|
end
|
|
@@ -16,7 +16,13 @@ module Sentdm
|
|
|
16
16
|
required :type, String
|
|
17
17
|
|
|
18
18
|
# @!attribute id
|
|
19
|
-
# The
|
|
19
|
+
# The button's identifier (1-based index), unique within the template.
|
|
20
|
+
#
|
|
21
|
+
# Omitting it is only safe for a template holding a single button. The field is a
|
|
22
|
+
# non-nullable int, so every button that leaves it out defaults to 0, and two such
|
|
23
|
+
# buttons are refused by the unique-id rule ("Button IDs must be unique"). Number
|
|
24
|
+
# them from 1 in the order they should appear — order matters on RCS, where only
|
|
25
|
+
# the first four buttons render.
|
|
20
26
|
#
|
|
21
27
|
# @return [Integer, nil]
|
|
22
28
|
optional :id, Integer
|
|
@@ -31,7 +37,7 @@ module Sentdm
|
|
|
31
37
|
#
|
|
32
38
|
# @param type [String] The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
|
|
33
39
|
#
|
|
34
|
-
# @param id [Integer] The
|
|
40
|
+
# @param id [Integer] The button's identifier (1-based index), unique within the template.
|
|
35
41
|
end
|
|
36
42
|
end
|
|
37
43
|
end
|
|
@@ -29,6 +29,17 @@ module Sentdm
|
|
|
29
29
|
required :quick_reply_type, String, api_name: :quickReplyType
|
|
30
30
|
|
|
31
31
|
# @!attribute text
|
|
32
|
+
# The button's label. Required for every button type, and capped at
|
|
33
|
+
# TemplateContentLimits.MaxButtonTextLength (25) characters.
|
|
34
|
+
#
|
|
35
|
+
# Meta accepts only static text here, so a label is refused when it contains a
|
|
36
|
+
# {{...}} variable placeholder, a newline, an emoji, or WhatsApp formatting markup
|
|
37
|
+
# (\*, \_, ~) — enforced by ApplyButtonLabelContentRules in
|
|
38
|
+
# TemplateButtonValidator. Meta reports all four as one error: "Buttons can't have
|
|
39
|
+
# any variables, newlines, emojis, or formatting characters."
|
|
40
|
+
#
|
|
41
|
+
# AUTHENTICATION OTP buttons are the exception: Meta auto-localizes their label
|
|
42
|
+
# from the template language, and the converter drops whatever text was sent.
|
|
32
43
|
#
|
|
33
44
|
# @return [String]
|
|
34
45
|
required :text, String
|
|
@@ -85,7 +96,7 @@ module Sentdm
|
|
|
85
96
|
#
|
|
86
97
|
# @param quick_reply_type [String]
|
|
87
98
|
#
|
|
88
|
-
# @param text [String]
|
|
99
|
+
# @param text [String] The button's label. Required for every button type, and capped at
|
|
89
100
|
#
|
|
90
101
|
# @param url [String]
|
|
91
102
|
#
|
|
@@ -4,7 +4,16 @@ module Sentdm
|
|
|
4
4
|
module Models
|
|
5
5
|
class TemplateDefinition < Sentdm::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute body
|
|
7
|
-
# Body section of a message template
|
|
7
|
+
# Body section of a message template.
|
|
8
|
+
#
|
|
9
|
+
# A body picks one of two authoring strategies, and mixing them is refused
|
|
10
|
+
# (TemplateDefinitionValidator.HaveValidChannelConfiguration): a shared
|
|
11
|
+
# multiChannel body on its own, or an explicit sms + whatsapp pair, both present.
|
|
12
|
+
#
|
|
13
|
+
# multiChannel together with sms or whatsapp is rejected, and so is sms or
|
|
14
|
+
# whatsapp on its own — every template is expected to be deliverable on every
|
|
15
|
+
# channel. rcs is the one true override: it may accompany either strategy to vary
|
|
16
|
+
# the copy, but cannot stand alone.
|
|
8
17
|
#
|
|
9
18
|
# @return [Sentdm::Models::TemplateBody]
|
|
10
19
|
required :body, -> { Sentdm::TemplateBody }
|
|
@@ -43,10 +52,13 @@ module Sentdm
|
|
|
43
52
|
optional :header, -> { Sentdm::TemplateHeader }, nil?: true
|
|
44
53
|
|
|
45
54
|
# @!method initialize(body:, authentication_config: nil, buttons: nil, definition_version: nil, footer: nil, header: nil)
|
|
55
|
+
# Some parameter documentations has been truncated, see
|
|
56
|
+
# {Sentdm::Models::TemplateDefinition} for more details.
|
|
57
|
+
#
|
|
46
58
|
# Complete definition of a message template including header, body, footer, and
|
|
47
59
|
# buttons
|
|
48
60
|
#
|
|
49
|
-
# @param body [Sentdm::Models::TemplateBody] Body section of a message template
|
|
61
|
+
# @param body [Sentdm::Models::TemplateBody] Body section of a message template.
|
|
50
62
|
#
|
|
51
63
|
# @param authentication_config [Sentdm::Models::AuthenticationConfig, nil] Configuration for AUTHENTICATION category templates
|
|
52
64
|
#
|
|
@@ -4,16 +4,16 @@ module Sentdm
|
|
|
4
4
|
module Models
|
|
5
5
|
class TemplateEvent < Sentdm::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute event
|
|
7
|
-
# The specific event within the family, for example message.delivered
|
|
8
|
-
# message.received. Absent on events that have no subtype, so
|
|
9
|
-
# optional.
|
|
7
|
+
# The specific event within the family, for example message.delivered,
|
|
8
|
+
# message.received or contact.opt_out. Absent on events that have no subtype, so
|
|
9
|
+
# treat it as optional.
|
|
10
10
|
#
|
|
11
11
|
# @return [String, nil]
|
|
12
12
|
optional :event, String, nil?: true
|
|
13
13
|
|
|
14
14
|
# @!attribute field
|
|
15
|
-
# The event family, for example message or
|
|
16
|
-
# event for the specific change.
|
|
15
|
+
# The event family, for example message, templates or contact. Route on this
|
|
16
|
+
# first, then on event for the specific change.
|
|
17
17
|
#
|
|
18
18
|
# @return [String, nil]
|
|
19
19
|
optional :field, String
|
|
@@ -25,6 +25,12 @@ module Sentdm
|
|
|
25
25
|
# @return [Sentdm::Models::TemplateEventPayload, nil]
|
|
26
26
|
optional :payload, -> { Sentdm::TemplateEventPayload }, nil?: true
|
|
27
27
|
|
|
28
|
+
# @!attribute request_id
|
|
29
|
+
# The event-specific body.
|
|
30
|
+
#
|
|
31
|
+
# @return [String, nil]
|
|
32
|
+
optional :request_id, String, nil?: true
|
|
33
|
+
|
|
28
34
|
# @!attribute timestamp
|
|
29
35
|
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
30
36
|
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
@@ -33,19 +39,21 @@ module Sentdm
|
|
|
33
39
|
# @return [String, nil]
|
|
34
40
|
optional :timestamp, String
|
|
35
41
|
|
|
36
|
-
# @!method initialize(event: nil, field: nil, payload: nil, timestamp: nil)
|
|
42
|
+
# @!method initialize(event: nil, field: nil, payload: nil, request_id: nil, timestamp: nil)
|
|
37
43
|
# Some parameter documentations has been truncated, see
|
|
38
44
|
# {Sentdm::Models::TemplateEvent} for more details.
|
|
39
45
|
#
|
|
40
46
|
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
41
47
|
# this shape and varies only in Payload.
|
|
42
48
|
#
|
|
43
|
-
# @param event [String, nil] The specific event within the family, for example message.delivered
|
|
49
|
+
# @param event [String, nil] The specific event within the family, for example message.delivered,
|
|
44
50
|
#
|
|
45
|
-
# @param field [String] The event family, for example message or
|
|
51
|
+
# @param field [String] The event family, for example message, templates or contact. Route on
|
|
46
52
|
#
|
|
47
53
|
# @param payload [Sentdm::Models::TemplateEventPayload, nil] Body of a template status event. Delivered when a template's review outcome chan
|
|
48
54
|
#
|
|
55
|
+
# @param request_id [String, nil] The event-specific body.
|
|
56
|
+
#
|
|
49
57
|
# @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
50
58
|
end
|
|
51
59
|
end
|
|
@@ -22,6 +22,25 @@ module Sentdm
|
|
|
22
22
|
# @return [String, nil]
|
|
23
23
|
optional :account_id, String
|
|
24
24
|
|
|
25
|
+
# @!attribute auto_reply_action
|
|
26
|
+
# Which consent keyword this template answers, when it is one of Sent's
|
|
27
|
+
# auto-replies: OPT_IN, OPT_OUT, HELP, or OTHER for a customer-defined keyword.
|
|
28
|
+
#
|
|
29
|
+
# Omitted for an ordinary template, so its presence is the answer to "is this an
|
|
30
|
+
# auto-reply". Sent creates the three compliance auto-replies at signup and they
|
|
31
|
+
# go through review like any other template, so their events arrive mixed in with
|
|
32
|
+
# the customer's own with nothing else to tell them apart.
|
|
33
|
+
#
|
|
34
|
+
# Named for the reader rather than after Template.OptAction, which it is mapped
|
|
35
|
+
# from. The MCP tool result deliberately keeps OptAction, OptKeywords and IsOpt:
|
|
36
|
+
# it mirrors the internal shape on purpose and publishes the keywords too, so
|
|
37
|
+
# renaming one of the three there would leave a surface half in each vocabulary.
|
|
38
|
+
# Two names for one concept, each consistent within its own surface, chosen over a
|
|
39
|
+
# rename that breaks MCP clients silently.
|
|
40
|
+
#
|
|
41
|
+
# @return [String, nil]
|
|
42
|
+
optional :auto_reply_action, String, nil?: true
|
|
43
|
+
|
|
25
44
|
# @!attribute category
|
|
26
45
|
# The template's category, for example UTILITY, MARKETING, or AUTHENTICATION.
|
|
27
46
|
#
|
|
@@ -29,10 +48,16 @@ module Sentdm
|
|
|
29
48
|
optional :category, String
|
|
30
49
|
|
|
31
50
|
# @!attribute channel
|
|
32
|
-
# The channel
|
|
51
|
+
# The channel leg this decision is about, for example whatsapp, sms, or rcs. A
|
|
52
|
+
# template is reviewed per channel and the legs come back independently, so each
|
|
53
|
+
# one reports separately.
|
|
54
|
+
#
|
|
55
|
+
# Omitted when the decision applies to the template as a whole rather than to one
|
|
56
|
+
# leg. That event is the broader news: a template-wide rejection blocks every
|
|
57
|
+
# channel, whatever the individual legs say.
|
|
33
58
|
#
|
|
34
59
|
# @return [String, nil]
|
|
35
|
-
optional :channel, String
|
|
60
|
+
optional :channel, String, nil?: true
|
|
36
61
|
|
|
37
62
|
# @!attribute language
|
|
38
63
|
# The template's language code, for example en_US.
|
|
@@ -59,7 +84,7 @@ module Sentdm
|
|
|
59
84
|
# @return [String, nil]
|
|
60
85
|
optional :template_name, String
|
|
61
86
|
|
|
62
|
-
# @!method initialize(status:, whatsapp_template_id:, account_id: nil, category: nil, channel: nil, language: nil, reason: nil, template_id: nil, template_name: nil)
|
|
87
|
+
# @!method initialize(status:, whatsapp_template_id:, account_id: nil, auto_reply_action: nil, category: nil, channel: nil, language: nil, reason: nil, template_id: nil, template_name: nil)
|
|
63
88
|
# Some parameter documentations has been truncated, see
|
|
64
89
|
# {Sentdm::Models::TemplateEventPayload} for more details.
|
|
65
90
|
#
|
|
@@ -72,9 +97,11 @@ module Sentdm
|
|
|
72
97
|
#
|
|
73
98
|
# @param account_id [String] The account the template belongs to.
|
|
74
99
|
#
|
|
100
|
+
# @param auto_reply_action [String, nil] Which consent keyword this template answers, when it is one of Sent's auto-repli
|
|
101
|
+
#
|
|
75
102
|
# @param category [String] The template's category, for example UTILITY, MARKETING, or
|
|
76
103
|
#
|
|
77
|
-
# @param channel [String] The channel
|
|
104
|
+
# @param channel [String, nil] The channel leg this decision is about, for example whatsapp, sms, or rcs.
|
|
78
105
|
#
|
|
79
106
|
# @param language [String] The template's language code, for example en_US.
|
|
80
107
|
#
|
|
@@ -7,18 +7,6 @@ module Sentdm
|
|
|
7
7
|
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Sentdm::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!attribute page
|
|
11
|
-
# Page number (1-indexed)
|
|
12
|
-
#
|
|
13
|
-
# @return [Integer]
|
|
14
|
-
required :page, Integer
|
|
15
|
-
|
|
16
|
-
# @!attribute page_size
|
|
17
|
-
# Number of items per page
|
|
18
|
-
#
|
|
19
|
-
# @return [Integer]
|
|
20
|
-
required :page_size, Integer
|
|
21
|
-
|
|
22
10
|
# @!attribute category
|
|
23
11
|
# Optional category filter: MARKETING, UTILITY, AUTHENTICATION
|
|
24
12
|
#
|
|
@@ -35,6 +23,18 @@ module Sentdm
|
|
|
35
23
|
# @return [Boolean, nil]
|
|
36
24
|
optional :is_welcome_playground, Sentdm::Internal::Type::Boolean, nil?: true
|
|
37
25
|
|
|
26
|
+
# @!attribute page
|
|
27
|
+
# Page number (1-indexed)
|
|
28
|
+
#
|
|
29
|
+
# @return [Integer, nil]
|
|
30
|
+
optional :page, Integer
|
|
31
|
+
|
|
32
|
+
# @!attribute page_size
|
|
33
|
+
# Number of items per page
|
|
34
|
+
#
|
|
35
|
+
# @return [Integer, nil]
|
|
36
|
+
optional :page_size, Integer
|
|
37
|
+
|
|
38
38
|
# @!attribute search
|
|
39
39
|
# Optional search term for filtering templates
|
|
40
40
|
#
|
|
@@ -52,18 +52,18 @@ module Sentdm
|
|
|
52
52
|
# @return [String, nil]
|
|
53
53
|
optional :x_profile_id, String
|
|
54
54
|
|
|
55
|
-
# @!method initialize(
|
|
55
|
+
# @!method initialize(category: nil, is_welcome_playground: nil, page: nil, page_size: nil, search: nil, status: nil, x_profile_id: nil, request_options: {})
|
|
56
56
|
# Some parameter documentations has been truncated, see
|
|
57
57
|
# {Sentdm::Models::TemplateListParams} for more details.
|
|
58
58
|
#
|
|
59
|
-
# @param page [Integer] Page number (1-indexed)
|
|
60
|
-
#
|
|
61
|
-
# @param page_size [Integer] Number of items per page
|
|
62
|
-
#
|
|
63
59
|
# @param category [String, nil] Optional category filter: MARKETING, UTILITY, AUTHENTICATION
|
|
64
60
|
#
|
|
65
61
|
# @param is_welcome_playground [Boolean, nil] Accepted and ignored. It used to filter on the welcome-playground marker inside
|
|
66
62
|
#
|
|
63
|
+
# @param page [Integer] Page number (1-indexed)
|
|
64
|
+
#
|
|
65
|
+
# @param page_size [Integer] Number of items per page
|
|
66
|
+
#
|
|
67
67
|
# @param search [String, nil] Optional search term for filtering templates
|
|
68
68
|
#
|
|
69
69
|
# @param status [String, nil] Optional status filter: APPROVED, PENDING, REJECTED
|
|
@@ -4,6 +4,9 @@ module Sentdm
|
|
|
4
4
|
module Models
|
|
5
5
|
class TemplateVariable < Sentdm::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute name
|
|
7
|
+
# The variable's name, and the key callers use for it in a send request's
|
|
8
|
+
# parameters object. Must start with a letter and hold only letters, digits and
|
|
9
|
+
# underscores.
|
|
7
10
|
#
|
|
8
11
|
# @return [String]
|
|
9
12
|
required :name, String
|
|
@@ -14,20 +17,34 @@ module Sentdm
|
|
|
14
17
|
required :props, -> { Sentdm::TemplateVariable::Props }
|
|
15
18
|
|
|
16
19
|
# @!attribute type
|
|
20
|
+
# One of variable, link or media. Decides which Props fields are required.
|
|
17
21
|
#
|
|
18
22
|
# @return [String]
|
|
19
23
|
required :type, String
|
|
20
24
|
|
|
21
25
|
# @!attribute id
|
|
26
|
+
# The variable's index, and the number its {{index:variable}} placeholder refers
|
|
27
|
+
# to.
|
|
28
|
+
#
|
|
29
|
+
# Omitting it is only safe for a section holding a single variable. The field is a
|
|
30
|
+
# non-nullable int, so every variable that leaves it out defaults to 0, and a
|
|
31
|
+
# section with two such variables is refused by the unique-id rule ("variables
|
|
32
|
+
# must have unique IDs"). Number them from 0 in the order they appear.
|
|
22
33
|
#
|
|
23
34
|
# @return [Integer, nil]
|
|
24
35
|
optional :id, Integer
|
|
25
36
|
|
|
26
37
|
# @!method initialize(name:, props:, type:, id: nil)
|
|
27
|
-
#
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {Sentdm::Models::TemplateVariable} for more details.
|
|
40
|
+
#
|
|
41
|
+
# @param name [String] The variable's name, and the key callers use for it in a send request's paramete
|
|
42
|
+
#
|
|
28
43
|
# @param props [Sentdm::Models::TemplateVariable::Props]
|
|
29
|
-
#
|
|
30
|
-
# @param
|
|
44
|
+
#
|
|
45
|
+
# @param type [String] One of variable, link or media. Decides which Props fields
|
|
46
|
+
#
|
|
47
|
+
# @param id [Integer] The variable's index, and the number its {{index:variable}} placeholder refers t
|
|
31
48
|
|
|
32
49
|
# @see Sentdm::Models::TemplateVariable#props
|
|
33
50
|
class Props < Sentdm::Internal::Type::BaseModel
|
|
@@ -14,13 +14,13 @@ module Sentdm
|
|
|
14
14
|
|
|
15
15
|
# @!attribute page
|
|
16
16
|
#
|
|
17
|
-
# @return [Integer]
|
|
18
|
-
|
|
17
|
+
# @return [Integer, nil]
|
|
18
|
+
optional :page, Integer
|
|
19
19
|
|
|
20
20
|
# @!attribute page_size
|
|
21
21
|
#
|
|
22
|
-
# @return [Integer]
|
|
23
|
-
|
|
22
|
+
# @return [Integer, nil]
|
|
23
|
+
optional :page_size, Integer
|
|
24
24
|
|
|
25
25
|
# @!attribute search
|
|
26
26
|
#
|
|
@@ -32,7 +32,7 @@ module Sentdm
|
|
|
32
32
|
# @return [String, nil]
|
|
33
33
|
optional :x_profile_id, String
|
|
34
34
|
|
|
35
|
-
# @!method initialize(id:, page
|
|
35
|
+
# @!method initialize(id:, page: nil, page_size: nil, search: nil, x_profile_id: nil, request_options: {})
|
|
36
36
|
# @param id [String]
|
|
37
37
|
# @param page [Integer]
|
|
38
38
|
# @param page_size [Integer]
|