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
@@ -0,0 +1,91 @@
|
|
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 'SubscribedEvent' do
|
12
|
+
it "can read" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
17
|
+
.subscribed_events.list()
|
18
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
19
|
+
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'get',
|
23
|
+
url: 'https://events.twilio.com/v1/Subscriptions/DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribedEvents',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives read_empty responses" do
|
28
|
+
@holodeck.mock(Twilio::Response.new(
|
29
|
+
200,
|
30
|
+
%q[
|
31
|
+
{
|
32
|
+
"types": [],
|
33
|
+
"meta": {
|
34
|
+
"page": 0,
|
35
|
+
"page_size": 10,
|
36
|
+
"first_page_url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents?PageSize=10&Page=0",
|
37
|
+
"previous_page_url": null,
|
38
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents?PageSize=10&Page=0",
|
39
|
+
"next_page_url": null,
|
40
|
+
"key": "types"
|
41
|
+
}
|
42
|
+
}
|
43
|
+
]
|
44
|
+
))
|
45
|
+
|
46
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
47
|
+
.subscribed_events.list()
|
48
|
+
|
49
|
+
expect(actual).to_not eq(nil)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "receives read_results responses" do
|
53
|
+
@holodeck.mock(Twilio::Response.new(
|
54
|
+
200,
|
55
|
+
%q[
|
56
|
+
{
|
57
|
+
"types": [
|
58
|
+
{
|
59
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
60
|
+
"type": "Voice.Calls",
|
61
|
+
"version": 2,
|
62
|
+
"subscription_sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
63
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents/Voice.Calls"
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
67
|
+
"type": "Video.Rooms",
|
68
|
+
"version": 15,
|
69
|
+
"subscription_sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents/Video.Rooms"
|
71
|
+
}
|
72
|
+
],
|
73
|
+
"meta": {
|
74
|
+
"page": 0,
|
75
|
+
"page_size": 50,
|
76
|
+
"first_page_url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents?PageSize=50&Page=0",
|
77
|
+
"previous_page_url": null,
|
78
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents?PageSize=50&Page=0",
|
79
|
+
"next_page_url": null,
|
80
|
+
"key": "types"
|
81
|
+
}
|
82
|
+
}
|
83
|
+
]
|
84
|
+
))
|
85
|
+
|
86
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
87
|
+
.subscribed_events.list()
|
88
|
+
|
89
|
+
expect(actual).to_not eq(nil)
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,243 @@
|
|
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 'Subscription' do
|
12
|
+
it "can read" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.events.v1.subscriptions.list()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
expect(
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
21
|
+
method: 'get',
|
22
|
+
url: 'https://events.twilio.com/v1/Subscriptions',
|
23
|
+
))).to eq(true)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "receives read_empty responses" do
|
27
|
+
@holodeck.mock(Twilio::Response.new(
|
28
|
+
200,
|
29
|
+
%q[
|
30
|
+
{
|
31
|
+
"subscriptions": [],
|
32
|
+
"meta": {
|
33
|
+
"page": 0,
|
34
|
+
"page_size": 10,
|
35
|
+
"first_page_url": "https://events.twilio.com/v1/Subscriptions?PageSize=10&Page=0",
|
36
|
+
"previous_page_url": null,
|
37
|
+
"url": "https://events.twilio.com/v1/Subscriptions?PageSize=10&Page=0",
|
38
|
+
"next_page_url": null,
|
39
|
+
"key": "subscriptions"
|
40
|
+
}
|
41
|
+
}
|
42
|
+
]
|
43
|
+
))
|
44
|
+
|
45
|
+
actual = @client.events.v1.subscriptions.list()
|
46
|
+
|
47
|
+
expect(actual).to_not eq(nil)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "receives read_results responses" do
|
51
|
+
@holodeck.mock(Twilio::Response.new(
|
52
|
+
200,
|
53
|
+
%q[
|
54
|
+
{
|
55
|
+
"subscriptions": [
|
56
|
+
{
|
57
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
58
|
+
"date_created": "2015-07-30T20:00:00Z",
|
59
|
+
"date_updated": "2015-07-30T20:01:33Z",
|
60
|
+
"sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
61
|
+
"sink_sid": "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
62
|
+
"description": "A subscription",
|
63
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
64
|
+
"links": {
|
65
|
+
"subscribed_events": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents"
|
66
|
+
}
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
|
+
"date_created": "2015-07-30T20:00:00Z",
|
71
|
+
"date_updated": "2015-07-30T20:01:33Z",
|
72
|
+
"sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
|
73
|
+
"sink_sid": "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
74
|
+
"description": "Another subscription",
|
75
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
|
76
|
+
"links": {
|
77
|
+
"subscribed_events": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab/SubscribedEvents"
|
78
|
+
}
|
79
|
+
}
|
80
|
+
],
|
81
|
+
"meta": {
|
82
|
+
"page": 0,
|
83
|
+
"page_size": 20,
|
84
|
+
"first_page_url": "https://events.twilio.com/v1/Subscriptions?PageSize=20&Page=0",
|
85
|
+
"previous_page_url": null,
|
86
|
+
"url": "https://events.twilio.com/v1/Subscriptions?PageSize=20&Page=0",
|
87
|
+
"next_page_url": null,
|
88
|
+
"key": "subscriptions"
|
89
|
+
}
|
90
|
+
}
|
91
|
+
]
|
92
|
+
))
|
93
|
+
|
94
|
+
actual = @client.events.v1.subscriptions.list()
|
95
|
+
|
96
|
+
expect(actual).to_not eq(nil)
|
97
|
+
end
|
98
|
+
|
99
|
+
it "can fetch" do
|
100
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
101
|
+
|
102
|
+
expect {
|
103
|
+
@client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
104
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
105
|
+
|
106
|
+
expect(
|
107
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
108
|
+
method: 'get',
|
109
|
+
url: 'https://events.twilio.com/v1/Subscriptions/DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
110
|
+
))).to eq(true)
|
111
|
+
end
|
112
|
+
|
113
|
+
it "receives fetch responses" do
|
114
|
+
@holodeck.mock(Twilio::Response.new(
|
115
|
+
200,
|
116
|
+
%q[
|
117
|
+
{
|
118
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
119
|
+
"date_created": "2015-07-30T20:00:00Z",
|
120
|
+
"date_updated": "2015-07-30T20:01:33Z",
|
121
|
+
"sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
122
|
+
"sink_sid": "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
123
|
+
"description": "A subscription",
|
124
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
125
|
+
"links": {
|
126
|
+
"subscribed_events": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents"
|
127
|
+
}
|
128
|
+
}
|
129
|
+
]
|
130
|
+
))
|
131
|
+
|
132
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
133
|
+
|
134
|
+
expect(actual).to_not eq(nil)
|
135
|
+
end
|
136
|
+
|
137
|
+
it "can create" do
|
138
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
139
|
+
|
140
|
+
expect {
|
141
|
+
@client.events.v1.subscriptions.create(description: 'description', sink_sid: 'DGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', types: [{}])
|
142
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
143
|
+
|
144
|
+
values = {
|
145
|
+
'Description' => 'description',
|
146
|
+
'SinkSid' => 'DGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
147
|
+
'Types' => Twilio.serialize_list([{}]) { |e| Twilio.serialize_object(e) },
|
148
|
+
}
|
149
|
+
expect(
|
150
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
151
|
+
method: 'post',
|
152
|
+
url: 'https://events.twilio.com/v1/Subscriptions',
|
153
|
+
data: values,
|
154
|
+
))).to eq(true)
|
155
|
+
end
|
156
|
+
|
157
|
+
it "receives create responses" do
|
158
|
+
@holodeck.mock(Twilio::Response.new(
|
159
|
+
201,
|
160
|
+
%q[
|
161
|
+
{
|
162
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
163
|
+
"date_created": "2015-07-30T20:00:00Z",
|
164
|
+
"date_updated": "2015-07-30T20:01:33Z",
|
165
|
+
"sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
166
|
+
"sink_sid": "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
167
|
+
"description": "A subscription",
|
168
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
169
|
+
"links": {
|
170
|
+
"subscribed_events": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents"
|
171
|
+
}
|
172
|
+
}
|
173
|
+
]
|
174
|
+
))
|
175
|
+
|
176
|
+
actual = @client.events.v1.subscriptions.create(description: 'description', sink_sid: 'DGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', types: [{}])
|
177
|
+
|
178
|
+
expect(actual).to_not eq(nil)
|
179
|
+
end
|
180
|
+
|
181
|
+
it "can update" do
|
182
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
183
|
+
|
184
|
+
expect {
|
185
|
+
@client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
186
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
187
|
+
|
188
|
+
expect(
|
189
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
190
|
+
method: 'post',
|
191
|
+
url: 'https://events.twilio.com/v1/Subscriptions/DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
192
|
+
))).to eq(true)
|
193
|
+
end
|
194
|
+
|
195
|
+
it "receives update responses" do
|
196
|
+
@holodeck.mock(Twilio::Response.new(
|
197
|
+
200,
|
198
|
+
%q[
|
199
|
+
{
|
200
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
201
|
+
"date_created": "2015-07-30T20:00:00Z",
|
202
|
+
"date_updated": "2020-07-30T20:01:33Z",
|
203
|
+
"sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
204
|
+
"sink_sid": "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
|
205
|
+
"description": "Updated description",
|
206
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
207
|
+
"links": {
|
208
|
+
"subscribed_events": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents"
|
209
|
+
}
|
210
|
+
}
|
211
|
+
]
|
212
|
+
))
|
213
|
+
|
214
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
215
|
+
|
216
|
+
expect(actual).to_not eq(nil)
|
217
|
+
end
|
218
|
+
|
219
|
+
it "can delete" do
|
220
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
221
|
+
|
222
|
+
expect {
|
223
|
+
@client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
224
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
225
|
+
|
226
|
+
expect(
|
227
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
228
|
+
method: 'delete',
|
229
|
+
url: 'https://events.twilio.com/v1/Subscriptions/DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
230
|
+
))).to eq(true)
|
231
|
+
end
|
232
|
+
|
233
|
+
it "receives delete responses" do
|
234
|
+
@holodeck.mock(Twilio::Response.new(
|
235
|
+
204,
|
236
|
+
nil,
|
237
|
+
))
|
238
|
+
|
239
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
240
|
+
|
241
|
+
expect(actual).to eq(true)
|
242
|
+
end
|
243
|
+
end
|
@@ -0,0 +1,40 @@
|
|
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 'Deactivations' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.messaging.v1.deactivations().fetch()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
expect(
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
21
|
+
method: 'get',
|
22
|
+
url: 'https://messaging.twilio.com/v1/Deactivations',
|
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
|
+
"redirect_to": "https://www.twilio.com"
|
32
|
+
}
|
33
|
+
]
|
34
|
+
))
|
35
|
+
|
36
|
+
actual = @client.messaging.v1.deactivations().fetch()
|
37
|
+
|
38
|
+
expect(actual).to_not eq(nil)
|
39
|
+
end
|
40
|
+
end
|
@@ -208,4 +208,31 @@ describe 'EndUser' do
|
|
208
208
|
|
209
209
|
expect(actual).to_not eq(nil)
|
210
210
|
end
|
211
|
+
|
212
|
+
it "can delete" do
|
213
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
214
|
+
|
215
|
+
expect {
|
216
|
+
@client.numbers.v2.regulatory_compliance \
|
217
|
+
.end_users('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
218
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
219
|
+
|
220
|
+
expect(
|
221
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
222
|
+
method: 'delete',
|
223
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
224
|
+
))).to eq(true)
|
225
|
+
end
|
226
|
+
|
227
|
+
it "receives delete responses" do
|
228
|
+
@holodeck.mock(Twilio::Response.new(
|
229
|
+
204,
|
230
|
+
nil,
|
231
|
+
))
|
232
|
+
|
233
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
234
|
+
.end_users('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
235
|
+
|
236
|
+
expect(actual).to eq(true)
|
237
|
+
end
|
211
238
|
end
|
@@ -220,4 +220,31 @@ describe 'SupportingDocument' do
|
|
220
220
|
|
221
221
|
expect(actual).to_not eq(nil)
|
222
222
|
end
|
223
|
+
|
224
|
+
it "can delete" do
|
225
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
226
|
+
|
227
|
+
expect {
|
228
|
+
@client.numbers.v2.regulatory_compliance \
|
229
|
+
.supporting_documents('RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
230
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
231
|
+
|
232
|
+
expect(
|
233
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
234
|
+
method: 'delete',
|
235
|
+
url: 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
236
|
+
))).to eq(true)
|
237
|
+
end
|
238
|
+
|
239
|
+
it "receives delete responses" do
|
240
|
+
@holodeck.mock(Twilio::Response.new(
|
241
|
+
204,
|
242
|
+
nil,
|
243
|
+
))
|
244
|
+
|
245
|
+
actual = @client.numbers.v2.regulatory_compliance \
|
246
|
+
.supporting_documents('RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
247
|
+
|
248
|
+
expect(actual).to eq(true)
|
249
|
+
end
|
223
250
|
end
|
@@ -76,6 +76,7 @@ describe 'ExecutionStep' do
|
|
76
76
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
77
77
|
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
78
78
|
"execution_sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
79
|
+
"parent_step_sid": null,
|
79
80
|
"name": "incomingRequest",
|
80
81
|
"context": {},
|
81
82
|
"transitioned_from": "Trigger",
|