twilio-ruby 7.11.3 → 7.13.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/CHANGES.md +277 -0
- data/Gemfile.lock +2 -2
- data/README.md +2 -2
- data/examples/WebhookSignatureValidation.md +61 -0
- data/lib/rack/twilio_webhook_authentication.rb +30 -5
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +7 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -4
- data/lib/twilio-ruby/rest/client.rb +5 -0
- data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +108 -1
- data/lib/twilio-ruby/rest/content/v1/content.rb +10 -4
- data/lib/twilio-ruby/rest/conversations/v2/action.rb +9 -2
- data/lib/twilio-ruby/rest/conversations/v2/communication.rb +4 -1
- data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +21 -0
- data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +226 -7
- data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb +512 -17
- data/lib/twilio-ruby/rest/insights/v3/{capacity.rb → custom_field_mappings_capacity.rb} +26 -26
- data/lib/twilio-ruby/rest/insights/v3.rb +17 -7
- data/lib/twilio-ruby/rest/memory/v1/bulk.rb +22 -1
- data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +5 -5
- data/lib/twilio-ruby/rest/memory/v1/import.rb +21 -7
- data/lib/twilio-ruby/rest/memory/v1/observation.rb +9 -9
- data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/store.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +30 -2
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +30 -6
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +30 -6
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +45 -6
- data/lib/twilio-ruby/rest/numbers/v1.rb +0 -6
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +40 -0
- data/lib/twilio-ruby/rest/routes/v3/iso_country_code.rb +402 -0
- data/lib/twilio-ruby/rest/routes/v3.rb +43 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +5 -5
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +4 -4
- data/lib/twilio-ruby/rest/trusthub/v1.rb +2 -2
- data/lib/twilio-ruby/rest/webhooks/v1/auth_profile.rb +825 -0
- data/lib/twilio-ruby/rest/webhooks/v1/edge_zone.rb +320 -0
- data/lib/twilio-ruby/rest/webhooks/v1/operation.rb +513 -0
- data/lib/twilio-ruby/rest/webhooks/v1/rule.rb +818 -0
- data/lib/twilio-ruby/rest/webhooks/v1/setting.rb +1028 -0
- data/lib/twilio-ruby/rest/webhooks/v1/shared_key.rb +722 -0
- data/lib/twilio-ruby/rest/webhooks/v1/test.rb +228 -0
- data/lib/twilio-ruby/rest/webhooks/v1.rb +126 -0
- data/lib/twilio-ruby/rest/webhooks.rb +6 -0
- data/lib/twilio-ruby/rest/webhooks_base.rb +38 -0
- data/lib/twilio-ruby/security/request_validator.rb +54 -8
- data/lib/twilio-ruby/twiml/voice_response.rb +20 -5
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +15 -5
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +0 -165
- data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +0 -200
|
@@ -25,17 +25,69 @@ module Twilio
|
|
|
25
25
|
# @param [name]: [String] Name of the template.
|
|
26
26
|
# @param [category]: [String] A WhatsApp recognized template category.
|
|
27
27
|
# @param [send_ttl_seconds]: [String] Time-to-live in seconds for attempting to send a message with this Content
|
|
28
|
-
|
|
28
|
+
# @param [bid_amount]: [String] Maximum price per 1,000 message deliveries, expressed in the WABA currency's smallest unit (cents for USD). Only valid for MARKETING templates onboarded to Max Pricing.
|
|
29
|
+
attr_accessor :name, :category, :send_ttl_seconds, :bid_amount
|
|
29
30
|
def initialize(payload)
|
|
30
31
|
@name = payload["name"]
|
|
31
32
|
@category = payload["category"]
|
|
32
33
|
@send_ttl_seconds = payload["send_ttl_seconds"]
|
|
34
|
+
@bid_amount = payload["bid_amount"]
|
|
33
35
|
end
|
|
34
36
|
def to_json(options = {})
|
|
35
37
|
{
|
|
36
38
|
"name": @name,
|
|
37
39
|
"category": @category,
|
|
38
40
|
"send_ttl_seconds": @send_ttl_seconds,
|
|
41
|
+
"bid_amount": @bid_amount,
|
|
42
|
+
}.to_json(options)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class ContentApprovalUpdateRequest
|
|
47
|
+
# @param [bid_amount]: [String] Maximum price per 1,000 message deliveries, expressed in the WABA currency's smallest unit (cents for USD). Only valid for MARKETING templates onboarded to Max Pricing.
|
|
48
|
+
attr_accessor :bid_amount
|
|
49
|
+
def initialize(payload)
|
|
50
|
+
@bid_amount = payload["bid_amount"]
|
|
51
|
+
end
|
|
52
|
+
def to_json(options = {})
|
|
53
|
+
{
|
|
54
|
+
"bid_amount": @bid_amount,
|
|
55
|
+
}.to_json(options)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class ContentApprovalRequest
|
|
61
|
+
# @param [name]: [String] Name of the template.
|
|
62
|
+
# @param [category]: [String] A WhatsApp recognized template category.
|
|
63
|
+
# @param [send_ttl_seconds]: [String] Time-to-live in seconds for attempting to send a message with this Content
|
|
64
|
+
# @param [bid_amount]: [String] Maximum price per 1,000 message deliveries, expressed in the WABA currency's smallest unit (cents for USD). Only valid for MARKETING templates onboarded to Max Pricing.
|
|
65
|
+
attr_accessor :name, :category, :send_ttl_seconds, :bid_amount
|
|
66
|
+
def initialize(payload)
|
|
67
|
+
@name = payload["name"]
|
|
68
|
+
@category = payload["category"]
|
|
69
|
+
@send_ttl_seconds = payload["send_ttl_seconds"]
|
|
70
|
+
@bid_amount = payload["bid_amount"]
|
|
71
|
+
end
|
|
72
|
+
def to_json(options = {})
|
|
73
|
+
{
|
|
74
|
+
"name": @name,
|
|
75
|
+
"category": @category,
|
|
76
|
+
"send_ttl_seconds": @send_ttl_seconds,
|
|
77
|
+
"bid_amount": @bid_amount,
|
|
78
|
+
}.to_json(options)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
class ContentApprovalUpdateRequest
|
|
83
|
+
# @param [bid_amount]: [String] Maximum price per 1,000 message deliveries, expressed in the WABA currency's smallest unit (cents for USD). Only valid for MARKETING templates onboarded to Max Pricing.
|
|
84
|
+
attr_accessor :bid_amount
|
|
85
|
+
def initialize(payload)
|
|
86
|
+
@bid_amount = payload["bid_amount"]
|
|
87
|
+
end
|
|
88
|
+
def to_json(options = {})
|
|
89
|
+
{
|
|
90
|
+
"bid_amount": @bid_amount,
|
|
39
91
|
}.to_json(options)
|
|
40
92
|
end
|
|
41
93
|
end
|
|
@@ -101,6 +153,54 @@ module Twilio
|
|
|
101
153
|
)
|
|
102
154
|
end
|
|
103
155
|
|
|
156
|
+
##
|
|
157
|
+
# Update the ApprovalCreateInstance
|
|
158
|
+
# @param [ContentApprovalUpdateRequest] content_approval_update_request
|
|
159
|
+
# @return [ApprovalCreateInstance] Updated ApprovalCreateInstance
|
|
160
|
+
def update(content_approval_update_request: nil
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
164
|
+
headers['Content-Type'] = 'application/json'
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
payload = @version.update('PATCH', @uri, headers: headers, data: content_approval_update_request.to_json)
|
|
170
|
+
ApprovalCreateInstance.new(
|
|
171
|
+
@version,
|
|
172
|
+
payload,
|
|
173
|
+
content_sid: @solution[:content_sid],
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
##
|
|
178
|
+
# Update the ApprovalCreateInstanceMetadata
|
|
179
|
+
# @param [ContentApprovalUpdateRequest] content_approval_update_request
|
|
180
|
+
# @return [ApprovalCreateInstance] Updated ApprovalCreateInstance
|
|
181
|
+
def update_with_metadata(content_approval_update_request: nil
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
185
|
+
headers['Content-Type'] = 'application/json'
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
response = @version.update_with_metadata('PATCH', @uri, headers: headers, data: content_approval_update_request.to_json)
|
|
191
|
+
approval_create_instance = ApprovalCreateInstance.new(
|
|
192
|
+
@version,
|
|
193
|
+
response.body,
|
|
194
|
+
content_sid: @solution[:content_sid],
|
|
195
|
+
)
|
|
196
|
+
ApprovalCreateInstanceMetadata.new(
|
|
197
|
+
@version,
|
|
198
|
+
approval_create_instance,
|
|
199
|
+
response.headers,
|
|
200
|
+
response.status_code
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
|
|
104
204
|
|
|
105
205
|
|
|
106
206
|
|
|
@@ -163,6 +263,7 @@ module Twilio
|
|
|
163
263
|
'rejection_reason' => payload['rejection_reason'],
|
|
164
264
|
'allow_category_change' => payload['allow_category_change'],
|
|
165
265
|
'send_ttl_seconds' => payload['send_ttl_seconds'],
|
|
266
|
+
'bid_amount' => payload['bid_amount'],
|
|
166
267
|
}
|
|
167
268
|
end
|
|
168
269
|
|
|
@@ -209,6 +310,12 @@ module Twilio
|
|
|
209
310
|
@properties['send_ttl_seconds']
|
|
210
311
|
end
|
|
211
312
|
|
|
313
|
+
##
|
|
314
|
+
# @return [String] Maximum price per 1,000 message deliveries, expressed in the WABA currency's smallest unit (cents for USD). Only set for MARKETING templates onboarded to Max Pricing.
|
|
315
|
+
def bid_amount
|
|
316
|
+
@properties['bid_amount']
|
|
317
|
+
end
|
|
318
|
+
|
|
212
319
|
##
|
|
213
320
|
# Provide a user friendly representation
|
|
214
321
|
def to_s
|
|
@@ -71,7 +71,8 @@ module Twilio
|
|
|
71
71
|
# @param [id]: [String]
|
|
72
72
|
# @param [code]: [String]
|
|
73
73
|
# @param [webview_size]: [WebviewSizeType]
|
|
74
|
-
|
|
74
|
+
# @param [digitable_line]: [String]
|
|
75
|
+
attr_accessor :type, :title, :url, :phone, :id, :code, :webview_size, :digitable_line
|
|
75
76
|
def initialize(payload)
|
|
76
77
|
@type = payload["type"]
|
|
77
78
|
@title = payload["title"]
|
|
@@ -80,6 +81,7 @@ module Twilio
|
|
|
80
81
|
@id = payload["id"]
|
|
81
82
|
@code = payload["code"]
|
|
82
83
|
@webview_size = payload["webview_size"]
|
|
84
|
+
@digitable_line = payload["digitable_line"]
|
|
83
85
|
end
|
|
84
86
|
def to_json(options = {})
|
|
85
87
|
{
|
|
@@ -90,6 +92,7 @@ module Twilio
|
|
|
90
92
|
"id": @id,
|
|
91
93
|
"code": @code,
|
|
92
94
|
"webview_size": @webview_size,
|
|
95
|
+
"digitable_line": @digitable_line,
|
|
93
96
|
}.to_json(options)
|
|
94
97
|
end
|
|
95
98
|
end
|
|
@@ -492,7 +495,7 @@ module Twilio
|
|
|
492
495
|
{
|
|
493
496
|
"id": @id,
|
|
494
497
|
"title": @title,
|
|
495
|
-
"
|
|
498
|
+
"time_slots": @time_slots,
|
|
496
499
|
}.to_json(options)
|
|
497
500
|
end
|
|
498
501
|
end
|
|
@@ -693,7 +696,8 @@ module Twilio
|
|
|
693
696
|
# @param [id]: [String]
|
|
694
697
|
# @param [code]: [String]
|
|
695
698
|
# @param [webview_size]: [WebviewSizeType]
|
|
696
|
-
|
|
699
|
+
# @param [digitable_line]: [String]
|
|
700
|
+
attr_accessor :type, :title, :url, :phone, :id, :code, :webview_size, :digitable_line
|
|
697
701
|
def initialize(payload)
|
|
698
702
|
@type = payload["type"]
|
|
699
703
|
@title = payload["title"]
|
|
@@ -702,6 +706,7 @@ module Twilio
|
|
|
702
706
|
@id = payload["id"]
|
|
703
707
|
@code = payload["code"]
|
|
704
708
|
@webview_size = payload["webview_size"]
|
|
709
|
+
@digitable_line = payload["digitable_line"]
|
|
705
710
|
end
|
|
706
711
|
def to_json(options = {})
|
|
707
712
|
{
|
|
@@ -712,6 +717,7 @@ module Twilio
|
|
|
712
717
|
"id": @id,
|
|
713
718
|
"code": @code,
|
|
714
719
|
"webview_size": @webview_size,
|
|
720
|
+
"digitable_line": @digitable_line,
|
|
715
721
|
}.to_json(options)
|
|
716
722
|
end
|
|
717
723
|
end
|
|
@@ -1114,7 +1120,7 @@ module Twilio
|
|
|
1114
1120
|
{
|
|
1115
1121
|
"id": @id,
|
|
1116
1122
|
"title": @title,
|
|
1117
|
-
"
|
|
1123
|
+
"time_slots": @time_slots,
|
|
1118
1124
|
}.to_json(options)
|
|
1119
1125
|
end
|
|
1120
1126
|
end
|
|
@@ -353,6 +353,7 @@ module Twilio
|
|
|
353
353
|
'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
|
|
354
354
|
'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']),
|
|
355
355
|
'completed_at' => Twilio.deserialize_iso8601_datetime(payload['completed_at']),
|
|
356
|
+
'failure_reason' => payload['failure_reason'],
|
|
356
357
|
}
|
|
357
358
|
|
|
358
359
|
# Context
|
|
@@ -378,7 +379,7 @@ module Twilio
|
|
|
378
379
|
end
|
|
379
380
|
|
|
380
381
|
##
|
|
381
|
-
# @return [String] The type of action
|
|
382
|
+
# @return [String] The type of action: action-send-message or action-start-flow.
|
|
382
383
|
def type
|
|
383
384
|
@properties['type']
|
|
384
385
|
end
|
|
@@ -396,7 +397,7 @@ module Twilio
|
|
|
396
397
|
end
|
|
397
398
|
|
|
398
399
|
##
|
|
399
|
-
# @return [Hash<String, String>] Named identifiers from downstream. For SEND_MESSAGE: - messageSid: The downstream message SID (present when PENDING or COMPLETED) - communicationId: The Communication ID (present when COMPLETED)
|
|
400
|
+
# @return [Hash<String, String>] Named identifiers from downstream. For SEND_MESSAGE: - messageSid: The downstream message SID (present when PENDING or COMPLETED) - communicationId: The Communication ID (present when COMPLETED) For START_FLOW: - executionSid: The Studio Flow execution SID (present when COMPLETED)
|
|
400
401
|
def related
|
|
401
402
|
@properties['related']
|
|
402
403
|
end
|
|
@@ -419,6 +420,12 @@ module Twilio
|
|
|
419
420
|
@properties['completed_at']
|
|
420
421
|
end
|
|
421
422
|
|
|
423
|
+
##
|
|
424
|
+
# @return [String] Human-readable failure reason. Null unless status is FAILED.
|
|
425
|
+
def failure_reason
|
|
426
|
+
@properties['failure_reason']
|
|
427
|
+
end
|
|
428
|
+
|
|
422
429
|
##
|
|
423
430
|
# Fetch the ActionInstance
|
|
424
431
|
# @return [ActionInstance] Fetched ActionInstance
|
|
@@ -83,13 +83,15 @@ module Twilio
|
|
|
83
83
|
# @param [author]: [CommunicationList.CreateCommunicationInConversationRequestAuthor]
|
|
84
84
|
# @param [content]: [CommunicationList.CreateCommunicationInConversationRequestContent]
|
|
85
85
|
# @param [channel_id]: [String]
|
|
86
|
+
# @param [resource_id]: [String] External resource identifier for this Communication (e.g. MessageSid for SMS/RCS/WhatsApp, TranscriptionSid + MessageIndex for Voice). If a Communication with the same resourceId already exists in the Conversation, it is updated instead of a new one being created.
|
|
86
87
|
# @param [recipients]: [Array<CommunicationList.CreateCommunicationInConversationRequestRecipients>]
|
|
87
88
|
# @param [occurred_at]: [Time] Timestamp when this Communication occurred. If omitted, the server uses the current time.
|
|
88
|
-
attr_accessor :author, :content, :channel_id, :recipients, :occurred_at
|
|
89
|
+
attr_accessor :author, :content, :channel_id, :resource_id, :recipients, :occurred_at
|
|
89
90
|
def initialize(payload)
|
|
90
91
|
@author = payload["author"]
|
|
91
92
|
@content = payload["content"]
|
|
92
93
|
@channel_id = payload["channel_id"]
|
|
94
|
+
@resource_id = payload["resource_id"]
|
|
93
95
|
@recipients = payload["recipients"]
|
|
94
96
|
@occurred_at = payload["occurred_at"]
|
|
95
97
|
end
|
|
@@ -98,6 +100,7 @@ module Twilio
|
|
|
98
100
|
"author": @author,
|
|
99
101
|
"content": @content,
|
|
100
102
|
"channelId": @channel_id,
|
|
103
|
+
"resourceId": @resource_id,
|
|
101
104
|
"recipients": @recipients,
|
|
102
105
|
"occurredAt": @occurred_at,
|
|
103
106
|
}.to_json(options)
|
|
@@ -1584,7 +1584,10 @@ module Twilio
|
|
|
1584
1584
|
'channel_settings' => payload['channel_settings'],
|
|
1585
1585
|
'status_callbacks' => payload['status_callbacks'],
|
|
1586
1586
|
'intelligence_configuration_ids' => payload['intelligence_configuration_ids'],
|
|
1587
|
+
'trait_extraction_strategy_ids' => payload['trait_extraction_strategy_ids'],
|
|
1588
|
+
'observation_extraction_strategy_ids' => payload['observation_extraction_strategy_ids'],
|
|
1587
1589
|
'memory_extraction_enabled' => payload['memory_extraction_enabled'],
|
|
1590
|
+
'redaction_configuration_id' => payload['redaction_configuration_id'],
|
|
1588
1591
|
'conversations_v1_bridge' => payload['conversations_v1_bridge'],
|
|
1589
1592
|
'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
|
|
1590
1593
|
'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']),
|
|
@@ -1667,12 +1670,30 @@ module Twilio
|
|
|
1667
1670
|
@properties['intelligence_configuration_ids']
|
|
1668
1671
|
end
|
|
1669
1672
|
|
|
1673
|
+
##
|
|
1674
|
+
# @return [Array<String>] A list of Trait Extraction Strategy IDs.
|
|
1675
|
+
def trait_extraction_strategy_ids
|
|
1676
|
+
@properties['trait_extraction_strategy_ids']
|
|
1677
|
+
end
|
|
1678
|
+
|
|
1679
|
+
##
|
|
1680
|
+
# @return [Array<String>] A list of Observation Extraction Strategy IDs.
|
|
1681
|
+
def observation_extraction_strategy_ids
|
|
1682
|
+
@properties['observation_extraction_strategy_ids']
|
|
1683
|
+
end
|
|
1684
|
+
|
|
1670
1685
|
##
|
|
1671
1686
|
# @return [Boolean] Whether memory extraction is enabled for conversations under this configuration. Defaults to false.
|
|
1672
1687
|
def memory_extraction_enabled
|
|
1673
1688
|
@properties['memory_extraction_enabled']
|
|
1674
1689
|
end
|
|
1675
1690
|
|
|
1691
|
+
##
|
|
1692
|
+
# @return [String] The ID of the redaction configuration applied to communications in this configuration's conversations.
|
|
1693
|
+
def redaction_configuration_id
|
|
1694
|
+
@properties['redaction_configuration_id']
|
|
1695
|
+
end
|
|
1696
|
+
|
|
1676
1697
|
##
|
|
1677
1698
|
# @return [ConversationsV2ConversationsV1Bridge]
|
|
1678
1699
|
def conversations_v1_bridge
|