sentdm 0.46.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/client.rb +2 -2
  5. data/lib/sentdm/models/channels/sms/api_response_of_supplied_compliance.rb +67 -0
  6. data/lib/sentdm/models/channels/sms/ten_dlc_add_campaign_params.rb +161 -0
  7. data/lib/sentdm/models/channels/sms/ten_dlc_add_numbers_params.rb +65 -0
  8. data/lib/sentdm/models/channels/sms/ten_dlc_campaign_use_case.rb +56 -0
  9. data/lib/sentdm/models/channels/sms/ten_dlc_retrieve_compliance_params.rb +24 -0
  10. data/lib/sentdm/models/channels/sms/ten_dlc_update_campaign_params.rb +168 -0
  11. data/lib/sentdm/models/channels/sms_market.rb +1 -11
  12. data/lib/sentdm/models/channels/sms_number.rb +12 -1
  13. data/lib/sentdm/models/channels/supplied_campaign.rb +10 -0
  14. data/lib/sentdm/models/channels/supplied_compliance.rb +27 -1
  15. data/lib/sentdm/models/profiles/brand_campaign.rb +11 -1
  16. data/lib/sentdm/models/voice/call.rb +4 -3
  17. data/lib/sentdm/resources/channels/sms/ten_dlc.rb +310 -0
  18. data/lib/sentdm/resources/channels/sms.rb +35 -1
  19. data/lib/sentdm/resources/profiles/campaigns.rb +4 -1
  20. data/lib/sentdm/resources/sender_profiles.rb +5 -3
  21. data/lib/sentdm/resources/voice/calls/participants.rb +5 -5
  22. data/lib/sentdm/version.rb +1 -1
  23. data/lib/sentdm.rb +8 -0
  24. data/rbi/sentdm/client.rbi +2 -2
  25. data/rbi/sentdm/models/channels/sms/api_response_of_supplied_compliance.rbi +117 -0
  26. data/rbi/sentdm/models/channels/sms/ten_dlc_add_campaign_params.rbi +255 -0
  27. data/rbi/sentdm/models/channels/sms/ten_dlc_add_numbers_params.rbi +100 -0
  28. data/rbi/sentdm/models/channels/sms/ten_dlc_campaign_use_case.rbi +143 -0
  29. data/rbi/sentdm/models/channels/sms/ten_dlc_retrieve_compliance_params.rbi +45 -0
  30. data/rbi/sentdm/models/channels/sms/ten_dlc_update_campaign_params.rbi +264 -0
  31. data/rbi/sentdm/models/channels/sms_market.rbi +0 -12
  32. data/rbi/sentdm/models/channels/sms_number.rbi +14 -0
  33. data/rbi/sentdm/models/channels/supplied_campaign.rbi +13 -0
  34. data/rbi/sentdm/models/channels/supplied_compliance.rbi +40 -0
  35. data/rbi/sentdm/models/profiles/brand_campaign.rbi +15 -0
  36. data/rbi/sentdm/models/voice/call.rbi +8 -6
  37. data/rbi/sentdm/resources/channels/sms/ten_dlc.rbi +358 -0
  38. data/rbi/sentdm/resources/channels/sms.rbi +34 -1
  39. data/rbi/sentdm/resources/profiles/campaigns.rbi +4 -1
  40. data/rbi/sentdm/resources/sender_profiles.rbi +5 -3
  41. data/rbi/sentdm/resources/voice/calls/participants.rbi +5 -5
  42. data/sig/sentdm/models/channels/sms/api_response_of_supplied_compliance.rbs +43 -0
  43. data/sig/sentdm/models/channels/sms/ten_dlc_add_campaign_params.rbs +130 -0
  44. data/sig/sentdm/models/channels/sms/ten_dlc_add_numbers_params.rbs +54 -0
  45. data/sig/sentdm/models/channels/sms/ten_dlc_campaign_use_case.rbs +60 -0
  46. data/sig/sentdm/models/channels/sms/ten_dlc_retrieve_compliance_params.rbs +29 -0
  47. data/sig/sentdm/models/channels/sms/ten_dlc_update_campaign_params.rbs +137 -0
  48. data/sig/sentdm/models/channels/sms_market.rbs +0 -5
  49. data/sig/sentdm/models/channels/sms_number.rbs +10 -1
  50. data/sig/sentdm/models/channels/supplied_campaign.rbs +9 -0
  51. data/sig/sentdm/models/channels/supplied_compliance.rbs +5 -0
  52. data/sig/sentdm/models/profiles/brand_campaign.rbs +7 -0
  53. data/sig/sentdm/resources/channels/sms/ten_dlc.rbs +64 -0
  54. data/sig/sentdm/resources/channels/sms.rbs +2 -0
  55. metadata +26 -2
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ # @type [Sentdm::Internal::Type::Converter]
7
+ SuppliedCampaign = Sentdm::Internal::Type::HashOf[Sentdm::Internal::Type::Unknown]
8
+ end
9
+ end
10
+ end
@@ -40,6 +40,30 @@ module Sentdm
40
40
  # @return [Hash{Symbol=>Object}, nil]
41
41
  optional :campaign, Sentdm::Internal::Type::HashOf[Sentdm::Internal::Type::Unknown], nil?: true
42
42
 
43
+ # @!attribute campaigns
44
+ # Every campaign this market registers, each with inherit saying whose it is —
45
+ # oldest first.
46
+ #
47
+ # A list, because a market can now be on more than one. POST
48
+ # /v3/channels/sms/compliances/US/TEN_DLC/campaigns adds a campaign of the
49
+ # customer's own beside the one it has, and a profile running on its
50
+ # organization's campaign keeps that one when it adds its own. Campaign can only
51
+ # show one of them, so it stays as it was, for callers that read it, and this is
52
+ # where the rest are.
53
+ #
54
+ # The organization's campaign reads "inherit": true and the customer's own read
55
+ # "inherit": false. Each entry is the shape of Campaign plus id, the campaign's
56
+ # own id, so several can be told apart. Campaign carries no id, because it is sent
57
+ # back to PATCH, which refuses a key it does not declare; this list is read-only.
58
+ #
59
+ # Absent for a market that registers with nobody; empty for one that registers and
60
+ # has no campaign yet.
61
+ #
62
+ # @return [Array<Hash{Symbol=>Object}>, nil]
63
+ optional :campaigns,
64
+ Sentdm::Internal::Type::ArrayOf[Sentdm::Internal::Type::HashOf[Sentdm::Internal::Type::Unknown]],
65
+ nil?: true
66
+
43
67
  # @!attribute documents
44
68
  # What has been supplied for this market.
45
69
  #
@@ -56,7 +80,7 @@ module Sentdm
56
80
  -> { Sentdm::Internal::Type::ArrayOf[Sentdm::Channels::SuppliedDocument] },
57
81
  nil?: true
58
82
 
59
- # @!method initialize(brand: nil, campaign: nil, documents: nil)
83
+ # @!method initialize(brand: nil, campaign: nil, campaigns: nil, documents: nil)
60
84
  # Some parameter documentations has been truncated, see
61
85
  # {Sentdm::Models::Channels::SuppliedCompliance} for more details.
62
86
  #
@@ -82,6 +106,8 @@ module Sentdm
82
106
  #
83
107
  # @param campaign [Hash{Symbol=>Object}, nil] The programme this market registers, with inherit saying whose it is.
84
108
  #
109
+ # @param campaigns [Array<Hash{Symbol=>Object}>, nil] Every campaign this market registers, each with inherit saying whose it is — old
110
+ #
85
111
  # @param documents [Array<Sentdm::Models::Channels::SuppliedDocument>, nil] What has been supplied for this market.
86
112
  end
87
113
  end
@@ -72,6 +72,14 @@ module Sentdm
72
72
  # @return [String, nil]
73
73
  optional :help_message, String, api_name: :helpMessage, nil?: true
74
74
 
75
+ # @!attribute is_inherited
76
+ # Whether the campaign is the organization's, which the profile runs on, rather
77
+ # than one of the profile's own. A profile running on its organization's campaign
78
+ # can hold campaigns of its own beside it, and the list returns both.
79
+ #
80
+ # @return [Boolean, nil]
81
+ optional :is_inherited, Sentdm::Internal::Type::Boolean, api_name: :isInherited
82
+
75
83
  # @!attribute message_flow
76
84
  #
77
85
  # @return [String, nil]
@@ -166,7 +174,7 @@ module Sentdm
166
174
  # @return [String, nil]
167
175
  optional :volume, String, nil?: true
168
176
 
169
- # @!method initialize(id: nil, billed_date: nil, brand_id: nil, cost: nil, created_at: nil, customer_id: nil, dca_elections_complete: nil, dca_elections_completed_at: nil, description: nil, has_submission_transaction: nil, help_keywords: nil, help_message: nil, message_flow: nil, name: nil, optin_keywords: nil, optin_message: nil, optout_keywords: nil, optout_message: nil, privacy_policy_link: nil, status: nil, submitted_at: nil, submitted_to_tcr: nil, tcr_campaign_id: nil, tcr_sync_error: nil, terms_and_conditions_link: nil, type: nil, updated_at: nil, use_cases: nil, volume: nil)
177
+ # @!method initialize(id: nil, billed_date: nil, brand_id: nil, cost: nil, created_at: nil, customer_id: nil, dca_elections_complete: nil, dca_elections_completed_at: nil, description: nil, has_submission_transaction: nil, help_keywords: nil, help_message: nil, is_inherited: nil, message_flow: nil, name: nil, optin_keywords: nil, optin_message: nil, optout_keywords: nil, optout_message: nil, privacy_policy_link: nil, status: nil, submitted_at: nil, submitted_to_tcr: nil, tcr_campaign_id: nil, tcr_sync_error: nil, terms_and_conditions_link: nil, type: nil, updated_at: nil, use_cases: nil, volume: nil)
170
178
  # Some parameter documentations has been truncated, see
171
179
  # {Sentdm::Models::Profiles::BrandCampaign} for more details.
172
180
  #
@@ -196,6 +204,8 @@ module Sentdm
196
204
  #
197
205
  # @param help_message [String, nil]
198
206
  #
207
+ # @param is_inherited [Boolean] Whether the campaign is the organization's, which the profile runs on, rather th
208
+ #
199
209
  # @param message_flow [String, nil]
200
210
  #
201
211
  # @param name [String]
@@ -63,9 +63,10 @@ module Sentdm
63
63
 
64
64
  # @!attribute failure_reason
65
65
  # Why the call did not complete: callback_timeout, invalid_answer,
66
- # insufficient_balance, destination_blocked, callback_not_configured, rejected,
67
- # no_answer, or for an agent call agent_busy or agent_unreachable. Null while the
68
- # call is live, when it completed, and when it failed without a recorded reason
66
+ # insufficient_balance, payment_method_missing, destination_blocked,
67
+ # callback_not_configured, rejected, no_answer, or for an agent call agent_busy or
68
+ # agent_unreachable. Null while the call is live, when it completed, and when it
69
+ # failed without a recorded reason
69
70
  #
70
71
  # @return [String, nil]
71
72
  optional :failure_reason, String, nil?: true
@@ -0,0 +1,310 @@
1
+ # frozen_string_literal: true
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
+ # Some parameter documentations has been truncated, see
36
+ # {Sentdm::Models::Channels::SMS::TenDlcAddCampaignParams} for more details.
37
+ #
38
+ # Registers **a new campaign** on the US `TEN_DLC` market you already hold — the
39
+ # one market that registers campaigns. Use it when you want numbers for a
40
+ # different use case than the market's existing campaign covers. The campaign is
41
+ # filed under the brand the market files under — your organization's when you
42
+ # inherit its identity.
43
+ #
44
+ # ## What to send
45
+ #
46
+ # The new campaign's fields, at the top level of the body: use cases, consent
47
+ # narrative, volume, sample messages and keywords, under the
48
+ # `compliance.campaign.*` keys
49
+ # `GET /v3/compliance/requirements?country=US&type=TEN_DLC` lists, without that
50
+ # prefix. It has to be complete. A rejected field is keyed by its name
51
+ # (`description`). `id` and `inherit` are ignored, so an entry of
52
+ # `compliance.campaigns` can be sent as read.
53
+ #
54
+ # The identity is the market's and is not sent here. A market whose identity has
55
+ # no registration yet, or one not yet submitted for review, is `400`.
56
+ #
57
+ # ## What happens
58
+ #
59
+ # The campaign is recorded and goes for review; it is not filed with The Campaign
60
+ # Registry by this call. **It comes without numbers**: send its `id` from
61
+ # `compliance.campaigns` to `POST /v3/channels/sms/numbers/US/TEN_DLC` to give it
62
+ # some. **The campaign you already have, and its numbers, are not touched** —
63
+ # including a campaign you run on from your organization.
64
+ #
65
+ # **Each call files a new campaign**, which is charged when it is submitted. Send
66
+ # an `Idempotency-Key` so a retried request does not file a second one.
67
+ #
68
+ # To change the campaign a market already has, use
69
+ # `PATCH /v3/channels/sms/US/TEN_DLC`. Once a market holds more than one campaign,
70
+ # that `PATCH` refuses a campaign or numbers change (`409`) rather than guess
71
+ # which campaign is meant; numbers are added to a named campaign with
72
+ # `POST /v3/channels/sms/numbers/US/TEN_DLC`.
73
+ #
74
+ # Returns **the market**, in the shape `GET /v3/channels/sms/US/TEN_DLC` returns,
75
+ # with `202`.
76
+ #
77
+ # @overload add_campaign(idempotency_key:, description: nil, help_keywords: nil, help_message: nil, message_flow: nil, opt_in_keywords: nil, opt_in_message: nil, opt_out_keywords: nil, opt_out_message: nil, privacy_policy_link: nil, sandbox: nil, terms_and_conditions_link: nil, use_cases: nil, volume: nil, x_profile_id: nil, request_options: {})
78
+ #
79
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
80
+ #
81
+ # @param description [String] Body param: What this programme sends. TCR description: what recipients will get
82
+ #
83
+ # @param help_keywords [String] Body param: Help keywords. TCR helpKeywords, comma separated, e.g. HELP,INFO. Re
84
+ #
85
+ # @param help_message [String] Body param: Help reply. TCR helpMessage. Its presence is what sets subscriberHel
86
+ #
87
+ # @param message_flow [String] Body param: Consent narrative. TCR messageFlow: how recipients opt in, in prose.
88
+ #
89
+ # @param opt_in_keywords [String] Body param: Opt-in keywords. TCR optinKeywords, comma separated, e.g. START,YES.
90
+ #
91
+ # @param opt_in_message [String] Body param: Opt-in confirmation. TCR optinMessage. Should state message frequenc
92
+ #
93
+ # @param opt_out_keywords [String] Body param: Opt-out keywords. TCR optoutKeywords, comma separated. STOP, END, CA
94
+ #
95
+ # @param opt_out_message [String] Body param: Opt-out confirmation. TCR optoutMessage. Its presence is what sets s
96
+ #
97
+ # @param privacy_policy_link [String] Body param: Privacy policy URL. TCR privacyPolicyLink. Required when `compliance
98
+ #
99
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
100
+ #
101
+ # @param terms_and_conditions_link [String] Body param: Terms and conditions URL. TCR termsAndConditionsLink. Required when
102
+ #
103
+ # @param use_cases [Array<Sentdm::Models::Channels::SMS::TenDlcCampaignUseCase>] Body param: Use cases. What the campaign sends, and an example of each. One to f
104
+ #
105
+ # @param volume [String] Body param: Expected monthly volume. Decides how the campaign registers and whic
106
+ #
107
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
108
+ #
109
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
110
+ #
111
+ # @return [Sentdm::Models::Channels::APIResponseOfSMSMarket]
112
+ #
113
+ # @see Sentdm::Models::Channels::SMS::TenDlcAddCampaignParams
114
+ def add_campaign(params)
115
+ parsed, options = Sentdm::Channels::SMS::TenDlcAddCampaignParams.dump_request(params)
116
+ header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
117
+ @client.request(
118
+ method: :post,
119
+ path: "v3/channels/sms/compliances/US/TEN_DLC/campaigns",
120
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
121
+ body: parsed.except(*header_params.keys),
122
+ model: Sentdm::Channels::APIResponseOfSMSMarket,
123
+ options: options
124
+ )
125
+ end
126
+
127
+ # Some parameter documentations has been truncated, see
128
+ # {Sentdm::Models::Channels::SMS::TenDlcAddNumbersParams} for more details.
129
+ #
130
+ # Adds numbers to **one campaign of your own** on the US `TEN_DLC` market you
131
+ # hold, named by `campaign_id` — the `id` of an entry in the market's
132
+ # `compliance.campaigns`.
133
+ #
134
+ # ## What to send
135
+ #
136
+ # - `campaign_id` — the campaign. One you inherit from your organization is `400`:
137
+ # its numbers are the organization's. One out of service — expired, deactivated
138
+ # or released — is `409`.
139
+ # - `numbers` — the list `POST /v3/channels/sms` takes, one entry per area code.
140
+ #
141
+ # ## What happens
142
+ #
143
+ # The entries are **added** to what the campaign already asks for. With everything
144
+ # it asks for, a campaign holds at most 49 numbers, counting one for each sender
145
+ # profile inheriting it. A campaign the carriers have not approved yet gets its
146
+ # numbers when they do; an approved one gets them now. Until a number is assigned
147
+ # it reads as `PROVISIONING` in the market's `numbers`, with the area code it was
148
+ # asked for.
149
+ #
150
+ # Returns **the market**, in the shape `GET /v3/channels/sms/US/TEN_DLC` returns,
151
+ # with `202`.
152
+ #
153
+ # @overload add_numbers(campaign_id:, numbers:, idempotency_key:, sandbox: nil, x_profile_id: nil, request_options: {})
154
+ #
155
+ # @param campaign_id [String] Body param: The campaign to add the numbers to, as compliance.campaigns[].id rep
156
+ #
157
+ # @param numbers [Array<Sentdm::Models::Channels::SMSNumberRequest, nil>] Body param: The numbers to add, one entry per area code, e.g. [{"area_code": "41
158
+ #
159
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
160
+ #
161
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
162
+ #
163
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
164
+ #
165
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
166
+ #
167
+ # @return [Sentdm::Models::Channels::APIResponseOfSMSMarket]
168
+ #
169
+ # @see Sentdm::Models::Channels::SMS::TenDlcAddNumbersParams
170
+ def add_numbers(params)
171
+ parsed, options = Sentdm::Channels::SMS::TenDlcAddNumbersParams.dump_request(params)
172
+ header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
173
+ @client.request(
174
+ method: :post,
175
+ path: "v3/channels/sms/numbers/US/TEN_DLC",
176
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
177
+ body: parsed.except(*header_params.keys),
178
+ model: Sentdm::Channels::APIResponseOfSMSMarket,
179
+ options: options
180
+ )
181
+ end
182
+
183
+ # Some parameter documentations has been truncated, see
184
+ # {Sentdm::Models::Channels::SMS::TenDlcRetrieveComplianceParams} for more
185
+ # details.
186
+ #
187
+ # Reads what the US `TEN_DLC` market you hold has registered: the `brand` it files
188
+ # under, **every campaign** under `campaigns` (each with its `id` and `inherit`),
189
+ # and its `documents`. It is the `compliance` object
190
+ # `GET /v3/channels/sms/US/TEN_DLC` returns, without the sender and numbers.
191
+ #
192
+ # Use a campaign's `id` to change it with
193
+ # `PATCH /v3/channels/sms/compliances/US/TEN_DLC/campaigns/{campaignId}`, or to
194
+ # add numbers to it with `POST /v3/channels/sms/numbers/US/TEN_DLC`.
195
+ #
196
+ # Send `x-profile-id` with an organization key to read one of your profiles'
197
+ # markets.
198
+ #
199
+ # @overload retrieve_compliance(x_profile_id: nil, request_options: {})
200
+ #
201
+ # @param x_profile_id [String] Profile UUID to scope the request to a child profile. Only organization API keys
202
+ #
203
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
204
+ #
205
+ # @return [Sentdm::Models::Channels::SMS::APIResponseOfSuppliedCompliance]
206
+ #
207
+ # @see Sentdm::Models::Channels::SMS::TenDlcRetrieveComplianceParams
208
+ def retrieve_compliance(params = {})
209
+ parsed, options = Sentdm::Channels::SMS::TenDlcRetrieveComplianceParams.dump_request(params)
210
+ @client.request(
211
+ method: :get,
212
+ path: "v3/channels/sms/compliances/US/TEN_DLC",
213
+ headers: parsed.transform_keys(x_profile_id: "x-profile-id"),
214
+ model: Sentdm::Channels::SMS::APIResponseOfSuppliedCompliance,
215
+ options: options
216
+ )
217
+ end
218
+
219
+ # Some parameter documentations has been truncated, see
220
+ # {Sentdm::Models::Channels::SMS::TenDlcUpdateCampaignParams} for more details.
221
+ #
222
+ # Changes **one campaign of your own** on the US `TEN_DLC` market, named by its
223
+ # `id` in the market's `compliance.campaigns`.
224
+ #
225
+ # ## What to send
226
+ #
227
+ # The fields to change, at the top level of the body, under the
228
+ # `compliance.campaign.*` keys
229
+ # `GET /v3/compliance/requirements?country=US&type=TEN_DLC` lists, without that
230
+ # prefix. A field you leave out keeps its value, and a rejected one is keyed by
231
+ # its name. `id` and `"inherit": false` are ignored, so an entry of
232
+ # `compliance.campaigns` can be sent as read; `"inherit": true` is `400`, because
233
+ # this call changes a campaign's fields, not whose campaign you run on. The
234
+ # campaign only: add numbers with `POST /v3/channels/sms/numbers/US/TEN_DLC`, and
235
+ # change the brand or documents with `PATCH /v3/channels/sms/US/TEN_DLC`.
236
+ #
237
+ # ## When it can be changed
238
+ #
239
+ # Until it is filed with The Campaign Registry, and again when we ask you to
240
+ # correct it. That correction sends it back for review. A filed campaign is
241
+ # otherwise `409`, and so is a change between low and high volume once it is
242
+ # registered. A campaign you run on from your organization is `409` too: it is the
243
+ # organization's to change. So is one out of service: expired, deactivated or
244
+ # released.
245
+ #
246
+ # Returns **the market**, in the shape `GET /v3/channels/sms/US/TEN_DLC` returns.
247
+ #
248
+ # @overload update_campaign(campaign_id, description: nil, help_keywords: nil, help_message: nil, message_flow: nil, opt_in_keywords: nil, opt_in_message: nil, opt_out_keywords: nil, opt_out_message: nil, privacy_policy_link: nil, sandbox: nil, terms_and_conditions_link: nil, use_cases: nil, volume: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
249
+ #
250
+ # @param campaign_id [String] Path param: The campaign: its id in the market's compliance.campaigns.
251
+ #
252
+ # @param description [String] Body param: What this programme sends. TCR description: what recipients will get
253
+ #
254
+ # @param help_keywords [String] Body param: Help keywords. TCR helpKeywords, comma separated, e.g. HELP,INFO. Re
255
+ #
256
+ # @param help_message [String] Body param: Help reply. TCR helpMessage. Its presence is what sets subscriberHel
257
+ #
258
+ # @param message_flow [String] Body param: Consent narrative. TCR messageFlow: how recipients opt in, in prose.
259
+ #
260
+ # @param opt_in_keywords [String] Body param: Opt-in keywords. TCR optinKeywords, comma separated, e.g. START,YES.
261
+ #
262
+ # @param opt_in_message [String] Body param: Opt-in confirmation. TCR optinMessage. Should state message frequenc
263
+ #
264
+ # @param opt_out_keywords [String] Body param: Opt-out keywords. TCR optoutKeywords, comma separated. STOP, END, CA
265
+ #
266
+ # @param opt_out_message [String] Body param: Opt-out confirmation. TCR optoutMessage. Its presence is what sets s
267
+ #
268
+ # @param privacy_policy_link [String] Body param: Privacy policy URL. TCR privacyPolicyLink. Required when `compliance
269
+ #
270
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
271
+ #
272
+ # @param terms_and_conditions_link [String] Body param: Terms and conditions URL. TCR termsAndConditionsLink. Required when
273
+ #
274
+ # @param use_cases [Array<Sentdm::Models::Channels::SMS::TenDlcCampaignUseCase>] Body param: Use cases. What the campaign sends, and an example of each. One to f
275
+ #
276
+ # @param volume [String] Body param: Expected monthly volume. Decides how the campaign registers and whic
277
+ #
278
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
279
+ #
280
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
281
+ #
282
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
283
+ #
284
+ # @return [Sentdm::Models::Channels::APIResponseOfSMSMarket]
285
+ #
286
+ # @see Sentdm::Models::Channels::SMS::TenDlcUpdateCampaignParams
287
+ def update_campaign(campaign_id, params = {})
288
+ parsed, options = Sentdm::Channels::SMS::TenDlcUpdateCampaignParams.dump_request(params)
289
+ header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
290
+ @client.request(
291
+ method: :patch,
292
+ path: ["v3/channels/sms/compliances/US/TEN_DLC/campaigns/%1$s", campaign_id],
293
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
294
+ body: parsed.except(*header_params.keys),
295
+ model: Sentdm::Channels::APIResponseOfSMSMarket,
296
+ options: options
297
+ )
298
+ end
299
+
300
+ # @api private
301
+ #
302
+ # @param client [Sentdm::Client]
303
+ def initialize(client:)
304
+ @client = client
305
+ end
306
+ end
307
+ end
308
+ end
309
+ end
310
+ 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
+ # @return [Sentdm::Resources::Channels::SMS::TenDlc]
62
+ attr_reader :ten_dlc
63
+
34
64
  # Some parameter documentations has been truncated, see
35
65
  # {Sentdm::Models::Channels::SMSCreateParams} for more details.
36
66
  #
@@ -105,7 +135,10 @@ module Sentdm
105
135
  # read as `PROVISIONING` in the response's `numbers`, each with the area code it
106
136
  # was asked for. A profile inheriting your organization's campaign cannot request
107
137
  # `numbers` (`400`). `numbers` on a `TEN_DLC` market you already hold is `409`:
108
- # its numbers belong to its one campaign and are set when the market is created.
138
+ # change its campaign's numbers with `PATCH /v3/channels/sms/{country}/{type}`,
139
+ # add numbers to one of its campaigns with
140
+ # `POST /v3/channels/sms/numbers/US/TEN_DLC`, or add a new campaign with
141
+ # `POST /v3/channels/sms/compliances/US/TEN_DLC/campaigns`.
109
142
  #
110
143
  # **A market you already send in is `409`**: adding what is already there is a
111
144
  # mistake worth reporting rather than a silent no-op. A market is a
@@ -410,6 +443,7 @@ module Sentdm
410
443
  # @param client [Sentdm::Client]
411
444
  def initialize(client:)
412
445
  @client = client
446
+ @ten_dlc = Sentdm::Resources::Channels::SMS::TenDlc.new(client: client)
413
447
  end
414
448
  end
415
449
  end
@@ -118,7 +118,10 @@ module Sentdm
118
118
  # explicitly.
119
119
  #
120
120
  # Retrieves all campaigns linked to the profile's brand, including use cases and
121
- # sample messages. Returns inherited campaigns if inherit_tcr_campaign=true.
121
+ # sample messages. A profile with inherit_tcr_campaign=true gets its
122
+ # organization's campaigns and, beside them, any campaign of its own (added with
123
+ # POST /v3/channels/sms/compliances/US/TEN_DLC/campaigns); `isInherited` says
124
+ # which is which.
122
125
  #
123
126
  # @overload list(profile_id, x_profile_id: nil, request_options: {})
124
127
  #
@@ -14,8 +14,8 @@ module Sentdm
14
14
  # instead.
15
15
  #
16
16
  # **A sender is the exception.** A brand and a campaign can be inherited; a number
17
- # cannot. A profile either has a sender of its own or terminates through your
18
- # shared routes.
17
+ # cannot. A profile either has a sender of its own or reaches only the countries
18
+ # Sent runs a shared route for, and the US is not one of them.
19
19
  #
20
20
  # To act for a profile on any other resource, send `x-profile-id` with your
21
21
  # organization key rather than looking for a parallel set of endpoints.
@@ -37,7 +37,9 @@ module Sentdm
37
37
  #
38
38
  # **A sender is not one of them.** The brand and the campaign can be inherited; a
39
39
  # number cannot. A profile either has a sender of its own — `channels.sms` — or it
40
- # has none and terminates through the shared routes for that country.
40
+ # has none and reaches only the countries Sent runs a shared route for. The US has
41
+ # none: without a `TEN_DLC` number of its own, a profile's SMS to US numbers ends
42
+ # as `FAILED` with `DELIVERY_003`.
41
43
  #
42
44
  # ## Saying what a profile owns
43
45
  #
@@ -118,11 +118,11 @@ module Sentdm
118
118
  # conference room, and answers with the participant's own call record. The
119
119
  # participant is a call of their own: it has its own id, can be looked up and hung
120
120
  # up, and is billed and reported through call.completed and call.failed like any
121
- # other call. Every participant needs a positive balance. A phone participant is
122
- # called from caller_id, which must be one of your numbers, or from the call's
123
- # owning number when omitted, and needs a destination you may call. Only a call
124
- # your answer connected to a conference can take participants: a call connected to
125
- # a user or a number answers 409.
121
+ # other call. Every participant needs a payment method on file and a positive
122
+ # balance. A phone participant is called from caller_id, which must be one of your
123
+ # numbers, or from the call's owning number when omitted, and needs a destination
124
+ # you may call. Only a call your answer connected to a conference can take
125
+ # participants: a call connected to a user or a number answers 409.
126
126
  #
127
127
  # @overload add(id, caller_id: nil, sandbox: nil, to: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
128
128
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sentdm
4
- VERSION = "0.46.0"
4
+ VERSION = "0.48.0"
5
5
  end
data/lib/sentdm.rb CHANGED
@@ -128,6 +128,12 @@ require_relative "sentdm/models/channels/market_compliance"
128
128
  require_relative "sentdm/models/channels/rc_create_params"
129
129
  require_relative "sentdm/models/channels/rcs_address"
130
130
  require_relative "sentdm/models/channels/rcs_agent"
131
+ require_relative "sentdm/models/channels/sms/api_response_of_supplied_compliance"
132
+ require_relative "sentdm/models/channels/sms/ten_dlc_add_campaign_params"
133
+ require_relative "sentdm/models/channels/sms/ten_dlc_add_numbers_params"
134
+ require_relative "sentdm/models/channels/sms/ten_dlc_campaign_use_case"
135
+ require_relative "sentdm/models/channels/sms/ten_dlc_retrieve_compliance_params"
136
+ require_relative "sentdm/models/channels/sms/ten_dlc_update_campaign_params"
131
137
  require_relative "sentdm/models/channels/sms_create_params"
132
138
  require_relative "sentdm/models/channels/sms_list_params"
133
139
  require_relative "sentdm/models/channels/sms_market"
@@ -135,6 +141,7 @@ require_relative "sentdm/models/channels/sms_number"
135
141
  require_relative "sentdm/models/channels/sms_number_request"
136
142
  require_relative "sentdm/models/channels/sms_retrieve_params"
137
143
  require_relative "sentdm/models/channels/sms_update_params"
144
+ require_relative "sentdm/models/channels/supplied_campaign"
138
145
  require_relative "sentdm/models/channels/supplied_compliance"
139
146
  require_relative "sentdm/models/channels/supplied_document"
140
147
  require_relative "sentdm/models/channels/voice_callback_test"
@@ -349,6 +356,7 @@ require_relative "sentdm/models"
349
356
  require_relative "sentdm/resources/channels"
350
357
  require_relative "sentdm/resources/channels/rcs"
351
358
  require_relative "sentdm/resources/channels/sms"
359
+ require_relative "sentdm/resources/channels/sms/ten_dlc"
352
360
  require_relative "sentdm/resources/channels/voice"
353
361
  require_relative "sentdm/resources/channels/whatsapp"
354
362
  require_relative "sentdm/resources/compliance"
@@ -70,8 +70,8 @@ module Sentdm
70
70
  # instead.
71
71
  #
72
72
  # **A sender is the exception.** A brand and a campaign can be inherited; a number
73
- # cannot. A profile either has a sender of its own or terminates through your
74
- # shared routes.
73
+ # cannot. A profile either has a sender of its own or reaches only the countries
74
+ # Sent runs a shared route for, and the US is not one of them.
75
75
  #
76
76
  # To act for a profile on any other resource, send `x-profile-id` with your
77
77
  # organization key rather than looking for a parallel set of endpoints.