twilio-ruby 5.39.2 → 5.40.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGES.md +107 -1
- data/CONTRIBUTING.md +2 -2
- data/ISSUE_TEMPLATE.md +5 -1
- data/PULL_REQUEST_TEMPLATE.md +1 -1
- data/README.md +4 -3
- data/lib/twilio-ruby/framework/version.rb +4 -8
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +6 -4
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +85 -60
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -2
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +14 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +14 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +14 -0
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +8 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +2 -1
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +8 -4
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +11 -4
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +13 -6
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/conversations.rb +39 -3
- data/lib/twilio-ruby/rest/conversations/v1.rb +68 -5
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +268 -0
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +262 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +21 -10
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +13 -10
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +34 -19
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +48 -32
- data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -11
- data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +374 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +388 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +271 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +315 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +549 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +394 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +519 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +457 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +395 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +419 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +398 -0
- data/lib/twilio-ruby/rest/events.rb +72 -0
- data/lib/twilio-ruby/rest/events/v1.rb +90 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
- data/lib/twilio-ruby/rest/events/v1/schema.rb +226 -0
- data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +290 -0
- data/lib/twilio-ruby/rest/events/v1/sink.rb +380 -0
- data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +115 -0
- data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +119 -0
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +383 -0
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +216 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +2 -1
- data/lib/twilio-ruby/rest/messaging.rb +6 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v1/deactivation.rb +164 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +6 -3
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +12 -6
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +10 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +3 -3
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +16 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +10 -5
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +6 -3
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +1 -4
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +3 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +45 -4
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +14 -1
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
- data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +12 -11
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +17 -7
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +75 -9
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +6 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +1 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +6 -2
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +38 -23
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +2 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +2 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +201 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +21 -9
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +10 -2
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +7 -2
- data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -3
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +18 -9
- data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +0 -6
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +1 -4
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +2 -1
- data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +5 -19
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/version_spec.rb +53 -0
- data/spec/holodeck/holodeck.rb +3 -3
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +35 -36
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +39 -40
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +35 -36
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +25 -23
- data/spec/integration/api/v2010/account/message_spec.rb +37 -0
- data/spec/integration/bulkexports/v1/export/day_spec.rb +5 -5
- data/spec/integration/bulkexports/v1/export_configuration_spec.rb +4 -4
- data/spec/integration/bulkexports/v1/export_spec.rb +3 -3
- data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
- data/spec/integration/conversations/v1/configuration_spec.rb +87 -0
- data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
- data/spec/integration/conversations/v1/conversation/message_spec.rb +38 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +60 -4
- data/spec/integration/conversations/v1/conversation_spec.rb +35 -0
- data/spec/integration/conversations/v1/credential_spec.rb +219 -0
- data/spec/integration/conversations/v1/role_spec.rb +249 -0
- data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
- data/spec/integration/conversations/v1/service/configuration/notification_spec.rb +115 -0
- data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
- data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
- data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
- data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
- data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
- data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
- data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
- data/spec/integration/conversations/v1/service/user_spec.rb +230 -0
- data/spec/integration/conversations/v1/service_spec.rb +174 -0
- data/spec/integration/conversations/v1/user_spec.rb +220 -0
- data/spec/integration/events/v1/event_type_spec.rb +133 -0
- data/spec/integration/events/v1/schema/schema_version_spec.rb +126 -0
- data/spec/integration/events/v1/schema_spec.rb +46 -0
- data/spec/integration/events/v1/sink/sink_test_spec.rb +42 -0
- data/spec/integration/events/v1/sink/sink_validate_spec.rb +44 -0
- data/spec/integration/events/v1/sink_spec.rb +217 -0
- data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +91 -0
- data/spec/integration/events/v1/subscription_spec.rb +243 -0
- data/spec/integration/messaging/v1/deactivation_spec.rb +40 -0
- data/spec/integration/numbers/v2/regulatory_compliance/end_user_spec.rb +27 -0
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
- data/spec/integration/studio/v1/flow/execution/execution_step_spec.rb +1 -0
- data/spec/integration/studio/v2/flow/execution/execution_step_spec.rb +1 -0
- data/spec/integration/supersim/v1/sim_spec.rb +23 -0
- data/spec/integration/supersim/v1/usage_record_spec.rb +463 -18
- data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
- data/spec/integration/trunking/v1/trunk_spec.rb +4 -0
- data/spec/integration/verify/v2/service/access_token_spec.rb +1 -1
- data/spec/integration/verify/v2/service/entity/challenge_spec.rb +8 -8
- data/spec/integration/video/v1/room_spec.rb +37 -0
- data/spec/integration/wireless/v1/sim/data_session_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +82 -5
- data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
@@ -205,7 +205,7 @@ describe 'IncomingPhoneNumber' do
|
|
205
205
|
%q[
|
206
206
|
{
|
207
207
|
"end": 0,
|
208
|
-
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=
|
208
|
+
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
|
209
209
|
"incoming_phone_numbers": [
|
210
210
|
{
|
211
211
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -214,9 +214,10 @@ describe 'IncomingPhoneNumber' do
|
|
214
214
|
"api_version": "2010-04-01",
|
215
215
|
"beta": null,
|
216
216
|
"capabilities": {
|
217
|
-
"
|
217
|
+
"voice": true,
|
218
218
|
"sms": false,
|
219
|
-
"
|
219
|
+
"mms": true,
|
220
|
+
"fax": false
|
220
221
|
},
|
221
222
|
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
|
222
223
|
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
|
@@ -255,10 +256,10 @@ describe 'IncomingPhoneNumber' do
|
|
255
256
|
],
|
256
257
|
"next_page_uri": null,
|
257
258
|
"page": 0,
|
258
|
-
"page_size":
|
259
|
+
"page_size": 50,
|
259
260
|
"previous_page_uri": null,
|
260
261
|
"start": 0,
|
261
|
-
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=
|
262
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
|
262
263
|
}
|
263
264
|
]
|
264
265
|
))
|
@@ -275,14 +276,14 @@ describe 'IncomingPhoneNumber' do
|
|
275
276
|
%q[
|
276
277
|
{
|
277
278
|
"end": 0,
|
278
|
-
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=
|
279
|
+
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0",
|
279
280
|
"incoming_phone_numbers": [],
|
280
281
|
"next_page_uri": null,
|
281
282
|
"page": 0,
|
282
|
-
"page_size":
|
283
|
+
"page_size": 50,
|
283
284
|
"previous_page_uri": null,
|
284
285
|
"start": 0,
|
285
|
-
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=
|
286
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?FriendlyName=friendly_name&Beta=true&PhoneNumber=%2B19876543210&PageSize=50&Page=0"
|
286
287
|
}
|
287
288
|
]
|
288
289
|
))
|
@@ -319,34 +320,35 @@ describe 'IncomingPhoneNumber' do
|
|
319
320
|
"api_version": "2010-04-01",
|
320
321
|
"beta": false,
|
321
322
|
"capabilities": {
|
322
|
-
"
|
323
|
+
"voice": true,
|
323
324
|
"sms": false,
|
324
|
-
"
|
325
|
+
"mms": true,
|
326
|
+
"fax": false
|
325
327
|
},
|
326
328
|
"date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
|
327
329
|
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
|
328
330
|
"emergency_status": "Active",
|
329
331
|
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
330
|
-
"friendly_name": "
|
332
|
+
"friendly_name": "friendly_name",
|
331
333
|
"identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
332
334
|
"origin": "origin",
|
333
335
|
"phone_number": "+18089255327",
|
334
336
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
335
|
-
"sms_application_sid": "",
|
336
|
-
"sms_fallback_method": "
|
337
|
-
"sms_fallback_url": "",
|
338
|
-
"sms_method": "
|
339
|
-
"sms_url": "",
|
340
|
-
"status_callback": "",
|
341
|
-
"status_callback_method": "
|
337
|
+
"sms_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
338
|
+
"sms_fallback_method": "GET",
|
339
|
+
"sms_fallback_url": "https://example.com",
|
340
|
+
"sms_method": "GET",
|
341
|
+
"sms_url": "https://example.com",
|
342
|
+
"status_callback": "https://example.com",
|
343
|
+
"status_callback_method": "GET",
|
342
344
|
"trunk_sid": null,
|
343
345
|
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
|
344
|
-
"voice_application_sid": "",
|
346
|
+
"voice_application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
345
347
|
"voice_caller_id_lookup": false,
|
346
|
-
"voice_fallback_method": "
|
347
|
-
"voice_fallback_url":
|
348
|
-
"voice_method": "
|
349
|
-
"voice_url":
|
348
|
+
"voice_fallback_method": "GET",
|
349
|
+
"voice_fallback_url": "https://example.com",
|
350
|
+
"voice_method": "GET",
|
351
|
+
"voice_url": "https://example.com",
|
350
352
|
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
351
353
|
"voice_receive_mode": "voice",
|
352
354
|
"status": "in-use",
|
@@ -100,6 +100,43 @@ describe 'Message' do
|
|
100
100
|
expect(actual).to_not eq(nil)
|
101
101
|
end
|
102
102
|
|
103
|
+
it "receives create_with_messaging_service responses" do
|
104
|
+
@holodeck.mock(Twilio::Response.new(
|
105
|
+
201,
|
106
|
+
%q[
|
107
|
+
{
|
108
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
109
|
+
"api_version": "2010-04-01",
|
110
|
+
"body": "Hello! \ud83d\udc4d",
|
111
|
+
"date_created": "Thu, 30 Jul 2015 20:12:31 +0000",
|
112
|
+
"date_sent": "Thu, 30 Jul 2015 20:12:33 +0000",
|
113
|
+
"date_updated": "Thu, 30 Jul 2015 20:12:33 +0000",
|
114
|
+
"direction": "outbound-api",
|
115
|
+
"error_code": null,
|
116
|
+
"error_message": null,
|
117
|
+
"from": null,
|
118
|
+
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
119
|
+
"num_media": "0",
|
120
|
+
"num_segments": "1",
|
121
|
+
"price": null,
|
122
|
+
"price_unit": null,
|
123
|
+
"sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
124
|
+
"status": "sent",
|
125
|
+
"subresource_uris": {
|
126
|
+
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"
|
127
|
+
},
|
128
|
+
"to": "+14155552345",
|
129
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
130
|
+
}
|
131
|
+
]
|
132
|
+
))
|
133
|
+
|
134
|
+
actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
135
|
+
.messages.create(to: '+15558675310')
|
136
|
+
|
137
|
+
expect(actual).to_not eq(nil)
|
138
|
+
end
|
139
|
+
|
103
140
|
it "can delete" do
|
104
141
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
105
142
|
|
@@ -64,9 +64,9 @@ describe 'Day' do
|
|
64
64
|
"meta": {
|
65
65
|
"page": 0,
|
66
66
|
"page_size": 50,
|
67
|
-
"first_page_url": "https://bulkexports.twilio.com/v1/Exports/
|
67
|
+
"first_page_url": "https://bulkexports.twilio.com/v1/Exports/Messages/Days?PageSize=50&Page=0",
|
68
68
|
"previous_page_url": null,
|
69
|
-
"url": "https://bulkexports.twilio.com/v1/Exports/
|
69
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Days?PageSize=50&Page=0",
|
70
70
|
"next_page_url": null,
|
71
71
|
"key": "days"
|
72
72
|
}
|
@@ -89,7 +89,7 @@ describe 'Day' do
|
|
89
89
|
{
|
90
90
|
"day": "2017-04-01",
|
91
91
|
"size": 100,
|
92
|
-
"resource_type": "
|
92
|
+
"resource_type": "Messages",
|
93
93
|
"create_date": "2017-04-02",
|
94
94
|
"friendly_name": "friendly_name"
|
95
95
|
}
|
@@ -97,9 +97,9 @@ describe 'Day' do
|
|
97
97
|
"meta": {
|
98
98
|
"page": 0,
|
99
99
|
"page_size": 50,
|
100
|
-
"first_page_url": "https://bulkexports.twilio.com/v1/Exports/
|
100
|
+
"first_page_url": "https://bulkexports.twilio.com/v1/Exports/Messages/Days?PageSize=50&Page=0",
|
101
101
|
"previous_page_url": null,
|
102
|
-
"url": "https://bulkexports.twilio.com/v1/Exports/
|
102
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Days?PageSize=50&Page=0",
|
103
103
|
"next_page_url": null,
|
104
104
|
"key": "days"
|
105
105
|
}
|
@@ -28,11 +28,11 @@ describe 'ExportConfiguration' do
|
|
28
28
|
200,
|
29
29
|
%q[
|
30
30
|
{
|
31
|
-
"url": "https://bulkexports.twilio.com/v1/Exports/
|
31
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",
|
32
32
|
"enabled": true,
|
33
33
|
"webhook_url": "",
|
34
34
|
"webhook_method": "",
|
35
|
-
"resource_type": "
|
35
|
+
"resource_type": "Messages"
|
36
36
|
}
|
37
37
|
]
|
38
38
|
))
|
@@ -61,10 +61,10 @@ describe 'ExportConfiguration' do
|
|
61
61
|
200,
|
62
62
|
%q[
|
63
63
|
{
|
64
|
-
"url": "https://bulkexports.twilio.com/v1/Exports/
|
64
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",
|
65
65
|
"enabled": true,
|
66
66
|
"webhook_url": "",
|
67
|
-
"resource_type": "
|
67
|
+
"resource_type": "Messages",
|
68
68
|
"webhook_method": ""
|
69
69
|
}
|
70
70
|
]
|
@@ -28,10 +28,10 @@ describe 'Export' do
|
|
28
28
|
200,
|
29
29
|
%q[
|
30
30
|
{
|
31
|
-
"resource_type": "
|
32
|
-
"url": "https://bulkexports.twilio.com/v1/Exports/
|
31
|
+
"resource_type": "Messages",
|
32
|
+
"url": "https://bulkexports.twilio.com/v1/Exports/Messages",
|
33
33
|
"links": {
|
34
|
-
"days": "https://bulkexports.twilio.com/v1/Exports/
|
34
|
+
"days": "https://bulkexports.twilio.com/v1/Exports/Messages/Days"
|
35
35
|
}
|
36
36
|
}
|
37
37
|
]
|
@@ -13,13 +13,14 @@ describe 'Webhook' do
|
|
13
13
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
14
|
|
15
15
|
expect {
|
16
|
-
@client.conversations.v1.
|
16
|
+
@client.conversations.v1.configuration \
|
17
|
+
.webhooks().fetch()
|
17
18
|
}.to raise_exception(Twilio::REST::TwilioError)
|
18
19
|
|
19
20
|
expect(
|
20
21
|
@holodeck.has_request?(Holodeck::Request.new(
|
21
22
|
method: 'get',
|
22
|
-
url: 'https://conversations.twilio.com/v1/
|
23
|
+
url: 'https://conversations.twilio.com/v1/Configuration/Webhooks',
|
23
24
|
))).to eq(true)
|
24
25
|
end
|
25
26
|
|
@@ -37,12 +38,13 @@ describe 'Webhook' do
|
|
37
38
|
"onConversationUpdated"
|
38
39
|
],
|
39
40
|
"target": "webhook",
|
40
|
-
"url": "https://conversations.twilio.com/v1/
|
41
|
+
"url": "https://conversations.twilio.com/v1/Configuration/Webhooks"
|
41
42
|
}
|
42
43
|
]
|
43
44
|
))
|
44
45
|
|
45
|
-
actual = @client.conversations.v1.
|
46
|
+
actual = @client.conversations.v1.configuration \
|
47
|
+
.webhooks().fetch()
|
46
48
|
|
47
49
|
expect(actual).to_not eq(nil)
|
48
50
|
end
|
@@ -51,13 +53,14 @@ describe 'Webhook' do
|
|
51
53
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
52
54
|
|
53
55
|
expect {
|
54
|
-
@client.conversations.v1.
|
56
|
+
@client.conversations.v1.configuration \
|
57
|
+
.webhooks().update()
|
55
58
|
}.to raise_exception(Twilio::REST::TwilioError)
|
56
59
|
|
57
60
|
expect(
|
58
61
|
@holodeck.has_request?(Holodeck::Request.new(
|
59
62
|
method: 'post',
|
60
|
-
url: 'https://conversations.twilio.com/v1/
|
63
|
+
url: 'https://conversations.twilio.com/v1/Configuration/Webhooks',
|
61
64
|
))).to eq(true)
|
62
65
|
end
|
63
66
|
|
@@ -74,12 +77,13 @@ describe 'Webhook' do
|
|
74
77
|
"onConversationUpdated"
|
75
78
|
],
|
76
79
|
"target": "webhook",
|
77
|
-
"url": "https://conversations.twilio.com/v1/
|
80
|
+
"url": "https://conversations.twilio.com/v1/Configuration/Webhooks"
|
78
81
|
}
|
79
82
|
]
|
80
83
|
))
|
81
84
|
|
82
|
-
actual = @client.conversations.v1.
|
85
|
+
actual = @client.conversations.v1.configuration \
|
86
|
+
.webhooks().update()
|
83
87
|
|
84
88
|
expect(actual).to_not eq(nil)
|
85
89
|
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
require 'spec_helper.rb'
|
10
|
+
|
11
|
+
describe 'Configuration' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.conversations.v1.configuration().fetch()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
expect(
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
21
|
+
method: 'get',
|
22
|
+
url: 'https://conversations.twilio.com/v1/Configuration',
|
23
|
+
))).to eq(true)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "receives fetch responses" do
|
27
|
+
@holodeck.mock(Twilio::Response.new(
|
28
|
+
200,
|
29
|
+
%q[
|
30
|
+
{
|
31
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
32
|
+
"default_chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"default_messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"default_inactive_timer": "PT1M",
|
35
|
+
"default_closed_timer": "PT10M",
|
36
|
+
"url": "https://conversations.twilio.com/v1/Configuration",
|
37
|
+
"links": {
|
38
|
+
"service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration",
|
39
|
+
"webhooks": "https://conversations.twilio.com/v1/Configuration/Webhooks"
|
40
|
+
}
|
41
|
+
}
|
42
|
+
]
|
43
|
+
))
|
44
|
+
|
45
|
+
actual = @client.conversations.v1.configuration().fetch()
|
46
|
+
|
47
|
+
expect(actual).to_not eq(nil)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "can update" do
|
51
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
52
|
+
|
53
|
+
expect {
|
54
|
+
@client.conversations.v1.configuration().update()
|
55
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
56
|
+
|
57
|
+
expect(
|
58
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
59
|
+
method: 'post',
|
60
|
+
url: 'https://conversations.twilio.com/v1/Configuration',
|
61
|
+
))).to eq(true)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "receives update responses" do
|
65
|
+
@holodeck.mock(Twilio::Response.new(
|
66
|
+
200,
|
67
|
+
%q[
|
68
|
+
{
|
69
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
|
+
"default_chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
71
|
+
"default_messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
72
|
+
"default_inactive_timer": "PT1M",
|
73
|
+
"default_closed_timer": "PT10M",
|
74
|
+
"url": "https://conversations.twilio.com/v1/Configuration",
|
75
|
+
"links": {
|
76
|
+
"service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration",
|
77
|
+
"webhooks": "https://conversations.twilio.com/v1/Configuration/Webhooks"
|
78
|
+
}
|
79
|
+
}
|
80
|
+
]
|
81
|
+
))
|
82
|
+
|
83
|
+
actual = @client.conversations.v1.configuration().update()
|
84
|
+
|
85
|
+
expect(actual).to_not eq(nil)
|
86
|
+
end
|
87
|
+
end
|
@@ -31,6 +31,7 @@ describe 'DeliveryReceipt' do
|
|
31
31
|
%q[
|
32
32
|
{
|
33
33
|
"sid": "DYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
35
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
36
|
"message_sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
37
|
"channel_message_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -84,6 +85,7 @@ describe 'DeliveryReceipt' do
|
|
84
85
|
"delivery_receipts": [
|
85
86
|
{
|
86
87
|
"sid": "DYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
88
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
87
89
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
88
90
|
"message_sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
89
91
|
"channel_message_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -96,6 +98,7 @@ describe 'DeliveryReceipt' do
|
|
96
98
|
},
|
97
99
|
{
|
98
100
|
"sid": "DYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
101
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
99
102
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
100
103
|
"message_sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
101
104
|
"channel_message_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -108,6 +111,7 @@ describe 'DeliveryReceipt' do
|
|
108
111
|
},
|
109
112
|
{
|
110
113
|
"sid": "DYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
114
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
111
115
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
112
116
|
"message_sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
113
117
|
"channel_message_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -109,6 +109,44 @@ describe 'Message' do
|
|
109
109
|
expect(actual).to_not eq(nil)
|
110
110
|
end
|
111
111
|
|
112
|
+
it "receives create_no_attributes responses" do
|
113
|
+
@holodeck.mock(Twilio::Response.new(
|
114
|
+
201,
|
115
|
+
%q[
|
116
|
+
{
|
117
|
+
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
118
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
119
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
120
|
+
"body": "Hello",
|
121
|
+
"media": null,
|
122
|
+
"author": "message author",
|
123
|
+
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
124
|
+
"attributes": "{}",
|
125
|
+
"date_created": "2020-07-01T22:18:37Z",
|
126
|
+
"date_updated": "2020-07-01T22:18:37Z",
|
127
|
+
"index": 0,
|
128
|
+
"delivery": {
|
129
|
+
"total": 2,
|
130
|
+
"sent": "all",
|
131
|
+
"delivered": "some",
|
132
|
+
"read": "some",
|
133
|
+
"failed": "none",
|
134
|
+
"undelivered": "none"
|
135
|
+
},
|
136
|
+
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
137
|
+
"links": {
|
138
|
+
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts"
|
139
|
+
}
|
140
|
+
}
|
141
|
+
]
|
142
|
+
))
|
143
|
+
|
144
|
+
actual = @client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
145
|
+
.messages.create()
|
146
|
+
|
147
|
+
expect(actual).to_not eq(nil)
|
148
|
+
end
|
149
|
+
|
112
150
|
it "can update" do
|
113
151
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
114
152
|
|