sentdm 0.47.0 → 0.48.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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/models/channels/sms/api_response_of_supplied_compliance.rb +67 -0
  5. data/lib/sentdm/models/channels/sms/ten_dlc_add_campaign_params.rb +161 -0
  6. data/lib/sentdm/models/channels/sms/ten_dlc_add_numbers_params.rb +65 -0
  7. data/lib/sentdm/models/channels/sms/ten_dlc_campaign_use_case.rb +56 -0
  8. data/lib/sentdm/models/channels/sms/ten_dlc_retrieve_compliance_params.rb +24 -0
  9. data/lib/sentdm/models/channels/sms/ten_dlc_update_campaign_params.rb +168 -0
  10. data/lib/sentdm/resources/channels/sms/ten_dlc.rb +310 -0
  11. data/lib/sentdm/resources/channels/sms.rb +31 -0
  12. data/lib/sentdm/version.rb +1 -1
  13. data/lib/sentdm.rb +7 -0
  14. data/rbi/sentdm/models/channels/sms/api_response_of_supplied_compliance.rbi +117 -0
  15. data/rbi/sentdm/models/channels/sms/ten_dlc_add_campaign_params.rbi +255 -0
  16. data/rbi/sentdm/models/channels/sms/ten_dlc_add_numbers_params.rbi +100 -0
  17. data/rbi/sentdm/models/channels/sms/ten_dlc_campaign_use_case.rbi +143 -0
  18. data/rbi/sentdm/models/channels/sms/ten_dlc_retrieve_compliance_params.rbi +45 -0
  19. data/rbi/sentdm/models/channels/sms/ten_dlc_update_campaign_params.rbi +264 -0
  20. data/rbi/sentdm/resources/channels/sms/ten_dlc.rbi +358 -0
  21. data/rbi/sentdm/resources/channels/sms.rbi +30 -0
  22. data/sig/sentdm/models/channels/sms/api_response_of_supplied_compliance.rbs +43 -0
  23. data/sig/sentdm/models/channels/sms/ten_dlc_add_campaign_params.rbs +130 -0
  24. data/sig/sentdm/models/channels/sms/ten_dlc_add_numbers_params.rbs +54 -0
  25. data/sig/sentdm/models/channels/sms/ten_dlc_campaign_use_case.rbs +60 -0
  26. data/sig/sentdm/models/channels/sms/ten_dlc_retrieve_compliance_params.rbs +29 -0
  27. data/sig/sentdm/models/channels/sms/ten_dlc_update_campaign_params.rbs +137 -0
  28. data/sig/sentdm/resources/channels/sms/ten_dlc.rbs +64 -0
  29. data/sig/sentdm/resources/channels/sms.rbs +2 -0
  30. metadata +22 -1
@@ -0,0 +1,264 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ module SMS
7
+ class TenDlcUpdateCampaignParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ OrHash =
12
+ T.type_alias do
13
+ T.any(
14
+ Sentdm::Channels::SMS::TenDlcUpdateCampaignParams,
15
+ Sentdm::Internal::AnyHash
16
+ )
17
+ end
18
+
19
+ sig { returns(String) }
20
+ attr_accessor :campaign_id
21
+
22
+ # What this programme sends. TCR description: what recipients will get and why, in
23
+ # a sentence. The only one of these TCR takes verbatim as a description of the
24
+ # programme, which is why it is asked for rather than derived from the customer's
25
+ # name. Required when `compliance.campaign.inherit != true`.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :description
28
+
29
+ sig { params(description: String).void }
30
+ attr_writer :description
31
+
32
+ # Help keywords. TCR helpKeywords, comma separated, e.g. HELP,INFO. Required when
33
+ # `compliance.campaign.inherit != true`.
34
+ sig { returns(T.nilable(String)) }
35
+ attr_reader :help_keywords
36
+
37
+ sig { params(help_keywords: String).void }
38
+ attr_writer :help_keywords
39
+
40
+ # Help reply. TCR helpMessage. Its presence is what sets subscriberHelp. Required
41
+ # when `compliance.campaign.inherit != true`.
42
+ sig { returns(T.nilable(String)) }
43
+ attr_reader :help_message
44
+
45
+ sig { params(help_message: String).void }
46
+ attr_writer :help_message
47
+
48
+ # Consent narrative. TCR messageFlow: how recipients opt in, in prose. Under 40
49
+ # characters is refused, and carriers reject vague descriptions — say where opt-in
50
+ # happens, that the box is unchecked by default, and that consent is not a
51
+ # condition of purchase. Required when `compliance.campaign.inherit != true`.
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :message_flow
54
+
55
+ sig { params(message_flow: String).void }
56
+ attr_writer :message_flow
57
+
58
+ # Opt-in keywords. TCR optinKeywords, comma separated, e.g. START,YES. Required
59
+ # when `compliance.campaign.inherit != true`.
60
+ sig { returns(T.nilable(String)) }
61
+ attr_reader :opt_in_keywords
62
+
63
+ sig { params(opt_in_keywords: String).void }
64
+ attr_writer :opt_in_keywords
65
+
66
+ # Opt-in confirmation. TCR optinMessage. Should state message frequency and that
67
+ # rates may apply. Its presence is what sets subscriberOptin. Required when
68
+ # `compliance.campaign.inherit != true`.
69
+ sig { returns(T.nilable(String)) }
70
+ attr_reader :opt_in_message
71
+
72
+ sig { params(opt_in_message: String).void }
73
+ attr_writer :opt_in_message
74
+
75
+ # Opt-out keywords. TCR optoutKeywords, comma separated. STOP, END, CANCEL,
76
+ # UNSUBSCRIBE and QUIT are honoured regardless of what is declared. Required when
77
+ # `compliance.campaign.inherit != true`.
78
+ sig { returns(T.nilable(String)) }
79
+ attr_reader :opt_out_keywords
80
+
81
+ sig { params(opt_out_keywords: String).void }
82
+ attr_writer :opt_out_keywords
83
+
84
+ # Opt-out confirmation. TCR optoutMessage. Its presence is what sets
85
+ # subscriberOptout. Required when `compliance.campaign.inherit != true`.
86
+ sig { returns(T.nilable(String)) }
87
+ attr_reader :opt_out_message
88
+
89
+ sig { params(opt_out_message: String).void }
90
+ attr_writer :opt_out_message
91
+
92
+ # Privacy policy URL. TCR privacyPolicyLink. Required when
93
+ # `compliance.campaign.inherit != true`.
94
+ sig { returns(T.nilable(String)) }
95
+ attr_reader :privacy_policy_link
96
+
97
+ sig { params(privacy_policy_link: String).void }
98
+ attr_writer :privacy_policy_link
99
+
100
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
101
+ # for testing integrations without actual execution
102
+ sig { returns(T.nilable(T::Boolean)) }
103
+ attr_reader :sandbox
104
+
105
+ sig { params(sandbox: T::Boolean).void }
106
+ attr_writer :sandbox
107
+
108
+ # Terms and conditions URL. TCR termsAndConditionsLink. Required when
109
+ # `compliance.campaign.inherit != true`.
110
+ sig { returns(T.nilable(String)) }
111
+ attr_reader :terms_and_conditions_link
112
+
113
+ sig { params(terms_and_conditions_link: String).void }
114
+ attr_writer :terms_and_conditions_link
115
+
116
+ # Use cases. What the campaign sends, and an example of each. One to five entries;
117
+ # how they register is decided by volume, never declared. Required when
118
+ # `compliance.campaign.inherit != true`.
119
+ sig do
120
+ returns(
121
+ T.nilable(T::Array[Sentdm::Channels::SMS::TenDlcCampaignUseCase])
122
+ )
123
+ end
124
+ attr_reader :use_cases
125
+
126
+ sig do
127
+ params(
128
+ use_cases:
129
+ T::Array[Sentdm::Channels::SMS::TenDlcCampaignUseCase::OrHash]
130
+ ).void
131
+ end
132
+ attr_writer :use_cases
133
+
134
+ # Expected monthly volume. Decides how the campaign registers and which fee tier
135
+ # applies: below the low-volume threshold it registers as LOW_VOLUME with
136
+ # sub-use-cases, above it as a single use case or MIXED. Omitting it registers the
137
+ # campaign at the higher-fee standard tier.
138
+ sig { returns(T.nilable(String)) }
139
+ attr_reader :volume
140
+
141
+ sig { params(volume: String).void }
142
+ attr_writer :volume
143
+
144
+ sig { returns(T.nilable(String)) }
145
+ attr_reader :idempotency_key
146
+
147
+ sig { params(idempotency_key: String).void }
148
+ attr_writer :idempotency_key
149
+
150
+ sig { returns(T.nilable(String)) }
151
+ attr_reader :x_profile_id
152
+
153
+ sig { params(x_profile_id: String).void }
154
+ attr_writer :x_profile_id
155
+
156
+ sig do
157
+ params(
158
+ campaign_id: String,
159
+ description: String,
160
+ help_keywords: String,
161
+ help_message: String,
162
+ message_flow: String,
163
+ opt_in_keywords: String,
164
+ opt_in_message: String,
165
+ opt_out_keywords: String,
166
+ opt_out_message: String,
167
+ privacy_policy_link: String,
168
+ sandbox: T::Boolean,
169
+ terms_and_conditions_link: String,
170
+ use_cases:
171
+ T::Array[Sentdm::Channels::SMS::TenDlcCampaignUseCase::OrHash],
172
+ volume: String,
173
+ idempotency_key: String,
174
+ x_profile_id: String,
175
+ request_options: Sentdm::RequestOptions::OrHash
176
+ ).returns(T.attached_class)
177
+ end
178
+ def self.new(
179
+ campaign_id:,
180
+ # What this programme sends. TCR description: what recipients will get and why, in
181
+ # a sentence. The only one of these TCR takes verbatim as a description of the
182
+ # programme, which is why it is asked for rather than derived from the customer's
183
+ # name. Required when `compliance.campaign.inherit != true`.
184
+ description: nil,
185
+ # Help keywords. TCR helpKeywords, comma separated, e.g. HELP,INFO. Required when
186
+ # `compliance.campaign.inherit != true`.
187
+ help_keywords: nil,
188
+ # Help reply. TCR helpMessage. Its presence is what sets subscriberHelp. Required
189
+ # when `compliance.campaign.inherit != true`.
190
+ help_message: nil,
191
+ # Consent narrative. TCR messageFlow: how recipients opt in, in prose. Under 40
192
+ # characters is refused, and carriers reject vague descriptions — say where opt-in
193
+ # happens, that the box is unchecked by default, and that consent is not a
194
+ # condition of purchase. Required when `compliance.campaign.inherit != true`.
195
+ message_flow: nil,
196
+ # Opt-in keywords. TCR optinKeywords, comma separated, e.g. START,YES. Required
197
+ # when `compliance.campaign.inherit != true`.
198
+ opt_in_keywords: nil,
199
+ # Opt-in confirmation. TCR optinMessage. Should state message frequency and that
200
+ # rates may apply. Its presence is what sets subscriberOptin. Required when
201
+ # `compliance.campaign.inherit != true`.
202
+ opt_in_message: nil,
203
+ # Opt-out keywords. TCR optoutKeywords, comma separated. STOP, END, CANCEL,
204
+ # UNSUBSCRIBE and QUIT are honoured regardless of what is declared. Required when
205
+ # `compliance.campaign.inherit != true`.
206
+ opt_out_keywords: nil,
207
+ # Opt-out confirmation. TCR optoutMessage. Its presence is what sets
208
+ # subscriberOptout. Required when `compliance.campaign.inherit != true`.
209
+ opt_out_message: nil,
210
+ # Privacy policy URL. TCR privacyPolicyLink. Required when
211
+ # `compliance.campaign.inherit != true`.
212
+ privacy_policy_link: nil,
213
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
214
+ # for testing integrations without actual execution
215
+ sandbox: nil,
216
+ # Terms and conditions URL. TCR termsAndConditionsLink. Required when
217
+ # `compliance.campaign.inherit != true`.
218
+ terms_and_conditions_link: nil,
219
+ # Use cases. What the campaign sends, and an example of each. One to five entries;
220
+ # how they register is decided by volume, never declared. Required when
221
+ # `compliance.campaign.inherit != true`.
222
+ use_cases: nil,
223
+ # Expected monthly volume. Decides how the campaign registers and which fee tier
224
+ # applies: below the low-volume threshold it registers as LOW_VOLUME with
225
+ # sub-use-cases, above it as a single use case or MIXED. Omitting it registers the
226
+ # campaign at the higher-fee standard tier.
227
+ volume: nil,
228
+ idempotency_key: nil,
229
+ x_profile_id: nil,
230
+ request_options: {}
231
+ )
232
+ end
233
+
234
+ sig do
235
+ override.returns(
236
+ {
237
+ campaign_id: String,
238
+ description: String,
239
+ help_keywords: String,
240
+ help_message: String,
241
+ message_flow: String,
242
+ opt_in_keywords: String,
243
+ opt_in_message: String,
244
+ opt_out_keywords: String,
245
+ opt_out_message: String,
246
+ privacy_policy_link: String,
247
+ sandbox: T::Boolean,
248
+ terms_and_conditions_link: String,
249
+ use_cases:
250
+ T::Array[Sentdm::Channels::SMS::TenDlcCampaignUseCase],
251
+ volume: String,
252
+ idempotency_key: String,
253
+ x_profile_id: String,
254
+ request_options: Sentdm::RequestOptions
255
+ }
256
+ )
257
+ end
258
+ def to_hash
259
+ end
260
+ end
261
+ end
262
+ end
263
+ end
264
+ end
@@ -0,0 +1,358 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Resources
5
+ class Channels
6
+ class SMS
7
+ # The senders you send from, one per channel.
8
+ #
9
+ # **SMS is a list of markets**, each keyed by `(country, number_type)` — a
10
+ # customer can hold `us/10dlc` and `gb/alphanumeric` at once, so a market is
11
+ # addressed by the pair rather than by country alone. **WhatsApp and RCS are
12
+ # single**: a customer has one business account and one agent. **Voice is per
13
+ # number**: each number you hold can carry phone calls on its own
14
+ # (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do
15
+ # with its calls, one of them is the default line for calls placed from your app,
16
+ # and voice tokens are minted with `POST /v3/voice/tokens`. Read your voice
17
+ # numbers with `GET /v3/channels/voice` and change one with
18
+ # `PATCH /v3/channels/voice/{number}`.
19
+ #
20
+ # ## Compliance lives on the market
21
+ #
22
+ # Adding a market records everything that market registers with, in its
23
+ # `compliance` object. Only **US `TEN_DLC`** registers with a regime — The
24
+ # Campaign Registry — and it is the only market whose compliance carries `brand`
25
+ # and `campaign`. Everywhere else compliance is documents, and many markets ask
26
+ # for none at all.
27
+ #
28
+ # `GET` and `PATCH` on a market return and accept the same shape, so what comes
29
+ # back can be sent back: an omitted key is left alone, and a key reported in
30
+ # `requirements` is the path into the body that clears it.
31
+ #
32
+ # Call `GET /v3/compliance/requirements` first — it answers what a market demands
33
+ # before you hold it, with a body you can fill in and post.
34
+ class TenDlc
35
+ # Registers **a new campaign** on the US `TEN_DLC` market you already hold — the
36
+ # one market that registers campaigns. Use it when you want numbers for a
37
+ # different use case than the market's existing campaign covers. The campaign is
38
+ # filed under the brand the market files under — your organization's when you
39
+ # inherit its identity.
40
+ #
41
+ # ## What to send
42
+ #
43
+ # The new campaign's fields, at the top level of the body: use cases, consent
44
+ # narrative, volume, sample messages and keywords, under the
45
+ # `compliance.campaign.*` keys
46
+ # `GET /v3/compliance/requirements?country=US&type=TEN_DLC` lists, without that
47
+ # prefix. It has to be complete. A rejected field is keyed by its name
48
+ # (`description`). `id` and `inherit` are ignored, so an entry of
49
+ # `compliance.campaigns` can be sent as read.
50
+ #
51
+ # The identity is the market's and is not sent here. A market whose identity has
52
+ # no registration yet, or one not yet submitted for review, is `400`.
53
+ #
54
+ # ## What happens
55
+ #
56
+ # The campaign is recorded and goes for review; it is not filed with The Campaign
57
+ # Registry by this call. **It comes without numbers**: send its `id` from
58
+ # `compliance.campaigns` to `POST /v3/channels/sms/numbers/US/TEN_DLC` to give it
59
+ # some. **The campaign you already have, and its numbers, are not touched** —
60
+ # including a campaign you run on from your organization.
61
+ #
62
+ # **Each call files a new campaign**, which is charged when it is submitted. Send
63
+ # an `Idempotency-Key` so a retried request does not file a second one.
64
+ #
65
+ # To change the campaign a market already has, use
66
+ # `PATCH /v3/channels/sms/US/TEN_DLC`. Once a market holds more than one campaign,
67
+ # that `PATCH` refuses a campaign or numbers change (`409`) rather than guess
68
+ # which campaign is meant; numbers are added to a named campaign with
69
+ # `POST /v3/channels/sms/numbers/US/TEN_DLC`.
70
+ #
71
+ # Returns **the market**, in the shape `GET /v3/channels/sms/US/TEN_DLC` returns,
72
+ # with `202`.
73
+ sig do
74
+ params(
75
+ idempotency_key: String,
76
+ description: String,
77
+ help_keywords: String,
78
+ help_message: String,
79
+ message_flow: String,
80
+ opt_in_keywords: String,
81
+ opt_in_message: String,
82
+ opt_out_keywords: String,
83
+ opt_out_message: String,
84
+ privacy_policy_link: String,
85
+ sandbox: T::Boolean,
86
+ terms_and_conditions_link: String,
87
+ use_cases:
88
+ T::Array[Sentdm::Channels::SMS::TenDlcCampaignUseCase::OrHash],
89
+ volume: String,
90
+ x_profile_id: String,
91
+ request_options: Sentdm::RequestOptions::OrHash
92
+ ).returns(Sentdm::Channels::APIResponseOfSMSMarket)
93
+ end
94
+ def add_campaign(
95
+ # Header param: Unique key to ensure idempotent request processing. Must be 1-255
96
+ # alphanumeric characters, hyphens, or underscores. Responses are cached for 24
97
+ # hours per key per customer.
98
+ idempotency_key:,
99
+ # Body param: What this programme sends. TCR description: what recipients will get
100
+ # and why, in a sentence. The only one of these TCR takes verbatim as a
101
+ # description of the programme, which is why it is asked for rather than derived
102
+ # from the customer's name. Required when `compliance.campaign.inherit != true`.
103
+ description: nil,
104
+ # Body param: Help keywords. TCR helpKeywords, comma separated, e.g. HELP,INFO.
105
+ # Required when `compliance.campaign.inherit != true`.
106
+ help_keywords: nil,
107
+ # Body param: Help reply. TCR helpMessage. Its presence is what sets
108
+ # subscriberHelp. Required when `compliance.campaign.inherit != true`.
109
+ help_message: nil,
110
+ # Body param: Consent narrative. TCR messageFlow: how recipients opt in, in prose.
111
+ # Under 40 characters is refused, and carriers reject vague descriptions — say
112
+ # where opt-in happens, that the box is unchecked by default, and that consent is
113
+ # not a condition of purchase. Required when
114
+ # `compliance.campaign.inherit != true`.
115
+ message_flow: nil,
116
+ # Body param: Opt-in keywords. TCR optinKeywords, comma separated, e.g. START,YES.
117
+ # Required when `compliance.campaign.inherit != true`.
118
+ opt_in_keywords: nil,
119
+ # Body param: Opt-in confirmation. TCR optinMessage. Should state message
120
+ # frequency and that rates may apply. Its presence is what sets subscriberOptin.
121
+ # Required when `compliance.campaign.inherit != true`.
122
+ opt_in_message: nil,
123
+ # Body param: Opt-out keywords. TCR optoutKeywords, comma separated. STOP, END,
124
+ # CANCEL, UNSUBSCRIBE and QUIT are honoured regardless of what is declared.
125
+ # Required when `compliance.campaign.inherit != true`.
126
+ opt_out_keywords: nil,
127
+ # Body param: Opt-out confirmation. TCR optoutMessage. Its presence is what sets
128
+ # subscriberOptout. Required when `compliance.campaign.inherit != true`.
129
+ opt_out_message: nil,
130
+ # Body param: Privacy policy URL. TCR privacyPolicyLink. Required when
131
+ # `compliance.campaign.inherit != true`.
132
+ privacy_policy_link: nil,
133
+ # Body param: Sandbox flag - when true, the operation is simulated without side
134
+ # effects Useful for testing integrations without actual execution
135
+ sandbox: nil,
136
+ # Body param: Terms and conditions URL. TCR termsAndConditionsLink. Required when
137
+ # `compliance.campaign.inherit != true`.
138
+ terms_and_conditions_link: nil,
139
+ # Body param: Use cases. What the campaign sends, and an example of each. One to
140
+ # five entries; how they register is decided by volume, never declared. Required
141
+ # when `compliance.campaign.inherit != true`.
142
+ use_cases: nil,
143
+ # Body param: Expected monthly volume. Decides how the campaign registers and
144
+ # which fee tier applies: below the low-volume threshold it registers as
145
+ # LOW_VOLUME with sub-use-cases, above it as a single use case or MIXED. Omitting
146
+ # it registers the campaign at the higher-fee standard tier.
147
+ volume: nil,
148
+ # Header param: Profile UUID to scope the request to a child profile. Only
149
+ # organization API keys can use this header. The profile must belong to the
150
+ # calling organization.
151
+ x_profile_id: nil,
152
+ request_options: {}
153
+ )
154
+ end
155
+
156
+ # Adds numbers to **one campaign of your own** on the US `TEN_DLC` market you
157
+ # hold, named by `campaign_id` — the `id` of an entry in the market's
158
+ # `compliance.campaigns`.
159
+ #
160
+ # ## What to send
161
+ #
162
+ # - `campaign_id` — the campaign. One you inherit from your organization is `400`:
163
+ # its numbers are the organization's. One out of service — expired, deactivated
164
+ # or released — is `409`.
165
+ # - `numbers` — the list `POST /v3/channels/sms` takes, one entry per area code.
166
+ #
167
+ # ## What happens
168
+ #
169
+ # The entries are **added** to what the campaign already asks for. With everything
170
+ # it asks for, a campaign holds at most 49 numbers, counting one for each sender
171
+ # profile inheriting it. A campaign the carriers have not approved yet gets its
172
+ # numbers when they do; an approved one gets them now. Until a number is assigned
173
+ # it reads as `PROVISIONING` in the market's `numbers`, with the area code it was
174
+ # asked for.
175
+ #
176
+ # Returns **the market**, in the shape `GET /v3/channels/sms/US/TEN_DLC` returns,
177
+ # with `202`.
178
+ sig do
179
+ params(
180
+ campaign_id: String,
181
+ numbers:
182
+ T::Array[T.nilable(Sentdm::Channels::SMSNumberRequest::OrHash)],
183
+ idempotency_key: String,
184
+ sandbox: T::Boolean,
185
+ x_profile_id: String,
186
+ request_options: Sentdm::RequestOptions::OrHash
187
+ ).returns(Sentdm::Channels::APIResponseOfSMSMarket)
188
+ end
189
+ def add_numbers(
190
+ # Body param: The campaign to add the numbers to, as compliance.campaigns[].id
191
+ # reports it. Required.
192
+ campaign_id:,
193
+ # Body param: The numbers to add, one entry per area code, e.g. [{"area_code":
194
+ # "415", "quantity": 2}, {"quantity": 1}]. quantity defaults to 1, and an entry
195
+ # without area_code means any area code. Required.
196
+ #
197
+ # Added to what the campaign already asks for, never replacing it.
198
+ numbers:,
199
+ # Header param: Unique key to ensure idempotent request processing. Must be 1-255
200
+ # alphanumeric characters, hyphens, or underscores. Responses are cached for 24
201
+ # hours per key per customer.
202
+ idempotency_key:,
203
+ # Body param: Sandbox flag - when true, the operation is simulated without side
204
+ # effects Useful for testing integrations without actual execution
205
+ sandbox: nil,
206
+ # Header param: Profile UUID to scope the request to a child profile. Only
207
+ # organization API keys can use this header. The profile must belong to the
208
+ # calling organization.
209
+ x_profile_id: nil,
210
+ request_options: {}
211
+ )
212
+ end
213
+
214
+ # Reads what the US `TEN_DLC` market you hold has registered: the `brand` it files
215
+ # under, **every campaign** under `campaigns` (each with its `id` and `inherit`),
216
+ # and its `documents`. It is the `compliance` object
217
+ # `GET /v3/channels/sms/US/TEN_DLC` returns, without the sender and numbers.
218
+ #
219
+ # Use a campaign's `id` to change it with
220
+ # `PATCH /v3/channels/sms/compliances/US/TEN_DLC/campaigns/{campaignId}`, or to
221
+ # add numbers to it with `POST /v3/channels/sms/numbers/US/TEN_DLC`.
222
+ #
223
+ # Send `x-profile-id` with an organization key to read one of your profiles'
224
+ # markets.
225
+ sig do
226
+ params(
227
+ x_profile_id: String,
228
+ request_options: Sentdm::RequestOptions::OrHash
229
+ ).returns(Sentdm::Channels::SMS::APIResponseOfSuppliedCompliance)
230
+ end
231
+ def retrieve_compliance(
232
+ # Profile UUID to scope the request to a child profile. Only organization API keys
233
+ # can use this header. The profile must belong to the calling organization.
234
+ x_profile_id: nil,
235
+ request_options: {}
236
+ )
237
+ end
238
+
239
+ # Changes **one campaign of your own** on the US `TEN_DLC` market, named by its
240
+ # `id` in the market's `compliance.campaigns`.
241
+ #
242
+ # ## What to send
243
+ #
244
+ # The fields to change, at the top level of the body, under the
245
+ # `compliance.campaign.*` keys
246
+ # `GET /v3/compliance/requirements?country=US&type=TEN_DLC` lists, without that
247
+ # prefix. A field you leave out keeps its value, and a rejected one is keyed by
248
+ # its name. `id` and `"inherit": false` are ignored, so an entry of
249
+ # `compliance.campaigns` can be sent as read; `"inherit": true` is `400`, because
250
+ # this call changes a campaign's fields, not whose campaign you run on. The
251
+ # campaign only: add numbers with `POST /v3/channels/sms/numbers/US/TEN_DLC`, and
252
+ # change the brand or documents with `PATCH /v3/channels/sms/US/TEN_DLC`.
253
+ #
254
+ # ## When it can be changed
255
+ #
256
+ # Until it is filed with The Campaign Registry, and again when we ask you to
257
+ # correct it. That correction sends it back for review. A filed campaign is
258
+ # otherwise `409`, and so is a change between low and high volume once it is
259
+ # registered. A campaign you run on from your organization is `409` too: it is the
260
+ # organization's to change. So is one out of service: expired, deactivated or
261
+ # released.
262
+ #
263
+ # Returns **the market**, in the shape `GET /v3/channels/sms/US/TEN_DLC` returns.
264
+ sig do
265
+ params(
266
+ campaign_id: String,
267
+ description: String,
268
+ help_keywords: String,
269
+ help_message: String,
270
+ message_flow: String,
271
+ opt_in_keywords: String,
272
+ opt_in_message: String,
273
+ opt_out_keywords: String,
274
+ opt_out_message: String,
275
+ privacy_policy_link: String,
276
+ sandbox: T::Boolean,
277
+ terms_and_conditions_link: String,
278
+ use_cases:
279
+ T::Array[Sentdm::Channels::SMS::TenDlcCampaignUseCase::OrHash],
280
+ volume: String,
281
+ idempotency_key: String,
282
+ x_profile_id: String,
283
+ request_options: Sentdm::RequestOptions::OrHash
284
+ ).returns(Sentdm::Channels::APIResponseOfSMSMarket)
285
+ end
286
+ def update_campaign(
287
+ # Path param: The campaign: its id in the market's compliance.campaigns.
288
+ campaign_id,
289
+ # Body param: What this programme sends. TCR description: what recipients will get
290
+ # and why, in a sentence. The only one of these TCR takes verbatim as a
291
+ # description of the programme, which is why it is asked for rather than derived
292
+ # from the customer's name. Required when `compliance.campaign.inherit != true`.
293
+ description: nil,
294
+ # Body param: Help keywords. TCR helpKeywords, comma separated, e.g. HELP,INFO.
295
+ # Required when `compliance.campaign.inherit != true`.
296
+ help_keywords: nil,
297
+ # Body param: Help reply. TCR helpMessage. Its presence is what sets
298
+ # subscriberHelp. Required when `compliance.campaign.inherit != true`.
299
+ help_message: nil,
300
+ # Body param: Consent narrative. TCR messageFlow: how recipients opt in, in prose.
301
+ # Under 40 characters is refused, and carriers reject vague descriptions — say
302
+ # where opt-in happens, that the box is unchecked by default, and that consent is
303
+ # not a condition of purchase. Required when
304
+ # `compliance.campaign.inherit != true`.
305
+ message_flow: nil,
306
+ # Body param: Opt-in keywords. TCR optinKeywords, comma separated, e.g. START,YES.
307
+ # Required when `compliance.campaign.inherit != true`.
308
+ opt_in_keywords: nil,
309
+ # Body param: Opt-in confirmation. TCR optinMessage. Should state message
310
+ # frequency and that rates may apply. Its presence is what sets subscriberOptin.
311
+ # Required when `compliance.campaign.inherit != true`.
312
+ opt_in_message: nil,
313
+ # Body param: Opt-out keywords. TCR optoutKeywords, comma separated. STOP, END,
314
+ # CANCEL, UNSUBSCRIBE and QUIT are honoured regardless of what is declared.
315
+ # Required when `compliance.campaign.inherit != true`.
316
+ opt_out_keywords: nil,
317
+ # Body param: Opt-out confirmation. TCR optoutMessage. Its presence is what sets
318
+ # subscriberOptout. Required when `compliance.campaign.inherit != true`.
319
+ opt_out_message: nil,
320
+ # Body param: Privacy policy URL. TCR privacyPolicyLink. Required when
321
+ # `compliance.campaign.inherit != true`.
322
+ privacy_policy_link: nil,
323
+ # Body param: Sandbox flag - when true, the operation is simulated without side
324
+ # effects Useful for testing integrations without actual execution
325
+ sandbox: nil,
326
+ # Body param: Terms and conditions URL. TCR termsAndConditionsLink. Required when
327
+ # `compliance.campaign.inherit != true`.
328
+ terms_and_conditions_link: nil,
329
+ # Body param: Use cases. What the campaign sends, and an example of each. One to
330
+ # five entries; how they register is decided by volume, never declared. Required
331
+ # when `compliance.campaign.inherit != true`.
332
+ use_cases: nil,
333
+ # Body param: Expected monthly volume. Decides how the campaign registers and
334
+ # which fee tier applies: below the low-volume threshold it registers as
335
+ # LOW_VOLUME with sub-use-cases, above it as a single use case or MIXED. Omitting
336
+ # it registers the campaign at the higher-fee standard tier.
337
+ volume: nil,
338
+ # Header param: Unique key to ensure idempotent request processing. Must be 1-255
339
+ # alphanumeric characters, hyphens, or underscores. Responses are cached for 24
340
+ # hours per key per customer.
341
+ idempotency_key: nil,
342
+ # Header param: Profile UUID to scope the request to a child profile. Only
343
+ # organization API keys can use this header. The profile must belong to the
344
+ # calling organization.
345
+ x_profile_id: nil,
346
+ request_options: {}
347
+ )
348
+ end
349
+
350
+ # @api private
351
+ sig { params(client: Sentdm::Client).returns(T.attached_class) }
352
+ def self.new(client:)
353
+ end
354
+ end
355
+ end
356
+ end
357
+ end
358
+ end
@@ -31,6 +31,36 @@ module Sentdm
31
31
  # Call `GET /v3/compliance/requirements` first — it answers what a market demands
32
32
  # before you hold it, with a body you can fill in and post.
33
33
  class SMS
34
+ # The senders you send from, one per channel.
35
+ #
36
+ # **SMS is a list of markets**, each keyed by `(country, number_type)` — a
37
+ # customer can hold `us/10dlc` and `gb/alphanumeric` at once, so a market is
38
+ # addressed by the pair rather than by country alone. **WhatsApp and RCS are
39
+ # single**: a customer has one business account and one agent. **Voice is per
40
+ # number**: each number you hold can carry phone calls on its own
41
+ # (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do
42
+ # with its calls, one of them is the default line for calls placed from your app,
43
+ # and voice tokens are minted with `POST /v3/voice/tokens`. Read your voice
44
+ # numbers with `GET /v3/channels/voice` and change one with
45
+ # `PATCH /v3/channels/voice/{number}`.
46
+ #
47
+ # ## Compliance lives on the market
48
+ #
49
+ # Adding a market records everything that market registers with, in its
50
+ # `compliance` object. Only **US `TEN_DLC`** registers with a regime — The
51
+ # Campaign Registry — and it is the only market whose compliance carries `brand`
52
+ # and `campaign`. Everywhere else compliance is documents, and many markets ask
53
+ # for none at all.
54
+ #
55
+ # `GET` and `PATCH` on a market return and accept the same shape, so what comes
56
+ # back can be sent back: an omitted key is left alone, and a key reported in
57
+ # `requirements` is the path into the body that clears it.
58
+ #
59
+ # Call `GET /v3/compliance/requirements` first — it answers what a market demands
60
+ # before you hold it, with a body you can fill in and post.
61
+ sig { returns(Sentdm::Resources::Channels::SMS::TenDlc) }
62
+ attr_reader :ten_dlc
63
+
34
64
  # Gives the customer a sender in one country — the first market it sends in, and
35
65
  # the fifth.
36
66
  #