twilio-ruby 5.46.1 → 5.47.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +31 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/events/v1/sink.rb +2 -1
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +1 -0
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
- data/lib/twilio-ruby/rest/messaging.rb +22 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +37 -0
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +328 -0
- data/lib/twilio-ruby/rest/messaging/v1/campaign.rb +387 -0
- data/lib/twilio-ruby/rest/messaging/v1/use_case.rb +198 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +4 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +11 -1
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +13 -13
- data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +4 -16
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +16 -12
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +16 -12
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +0 -6
- data/lib/twilio-ruby/twiml/voice_response.rb +4 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/conference_spec.rb +302 -44
- data/spec/integration/flex_api/v1/configuration_spec.rb +24 -0
- data/spec/integration/messaging/v1/brand_registration_spec.rb +143 -0
- data/spec/integration/messaging/v1/campaign_spec.rb +194 -0
- data/spec/integration/messaging/v1/use_case_spec.rb +55 -0
- data/spec/integration/preview/sync/service/document_spec.rb +1 -3
- data/spec/integration/serverless/v1/service/build_spec.rb +12 -2
- data/spec/integration/supersim/v1/fleet_spec.rb +8 -0
- data/spec/integration/sync/v1/service/document_spec.rb +1 -3
- metadata +11 -2
@@ -180,6 +180,14 @@ describe 'Configuration' do
|
|
180
180
|
"ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
181
181
|
"ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
|
182
182
|
],
|
183
|
+
"notifications": {
|
184
|
+
"enabled": true,
|
185
|
+
"mode": "whenNotInFocus"
|
186
|
+
},
|
187
|
+
"markdown": {
|
188
|
+
"enabled": false,
|
189
|
+
"mode": "readOnly"
|
190
|
+
},
|
183
191
|
"url": "https://flex-api.twilio.com/v1/Configuration"
|
184
192
|
}
|
185
193
|
]
|
@@ -361,6 +369,14 @@ describe 'Configuration' do
|
|
361
369
|
"ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
362
370
|
"ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
|
363
371
|
],
|
372
|
+
"notifications": {
|
373
|
+
"enabled": true,
|
374
|
+
"mode": "whenNotInFocus"
|
375
|
+
},
|
376
|
+
"markdown": {
|
377
|
+
"enabled": false,
|
378
|
+
"mode": "readOnly"
|
379
|
+
},
|
364
380
|
"url": "https://flex-api.twilio.com/v1/Configuration"
|
365
381
|
}
|
366
382
|
]
|
@@ -542,6 +558,14 @@ describe 'Configuration' do
|
|
542
558
|
"ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
543
559
|
"ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
|
544
560
|
],
|
561
|
+
"notifications": {
|
562
|
+
"enabled": true,
|
563
|
+
"mode": "whenNotInFocus"
|
564
|
+
},
|
565
|
+
"markdown": {
|
566
|
+
"enabled": false,
|
567
|
+
"mode": "readOnly"
|
568
|
+
},
|
545
569
|
"url": "https://flex-api.twilio.com/v1/Configuration"
|
546
570
|
}
|
547
571
|
]
|
@@ -0,0 +1,143 @@
|
|
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 'BrandRegistration' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.messaging.v1.brand_registrations('BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').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/a2p/BrandRegistrations/BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
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
|
+
"sid": "BN0044409f7e067e279523808d267e2d85",
|
32
|
+
"account_sid": "AC78e8e67fc0246521490fb9907fd0c165",
|
33
|
+
"customer_profile_bundle_sid": "BU3344409f7e067e279523808d267e2d85",
|
34
|
+
"a2p_profile_bundle_sid": "BU3344409f7e067e279523808d267e2d85",
|
35
|
+
"date_created": "2021-01-27T14:18:35Z",
|
36
|
+
"date_updated": "2021-01-27T14:18:36Z",
|
37
|
+
"status": "IN_PROGRESS",
|
38
|
+
"tcr_id": "BXXXXXX",
|
39
|
+
"failure_reason": "Registration error",
|
40
|
+
"url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85"
|
41
|
+
}
|
42
|
+
]
|
43
|
+
))
|
44
|
+
|
45
|
+
actual = @client.messaging.v1.brand_registrations('BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
46
|
+
|
47
|
+
expect(actual).to_not eq(nil)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "can read" do
|
51
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
52
|
+
|
53
|
+
expect {
|
54
|
+
@client.messaging.v1.brand_registrations.list()
|
55
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
56
|
+
|
57
|
+
expect(
|
58
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
59
|
+
method: 'get',
|
60
|
+
url: 'https://messaging.twilio.com/v1/a2p/BrandRegistrations',
|
61
|
+
))).to eq(true)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "receives read responses" do
|
65
|
+
@holodeck.mock(Twilio::Response.new(
|
66
|
+
200,
|
67
|
+
%q[
|
68
|
+
{
|
69
|
+
"meta": {
|
70
|
+
"page": 0,
|
71
|
+
"page_size": 50,
|
72
|
+
"first_page_url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations?PageSize=50&Page=0",
|
73
|
+
"previous_page_url": null,
|
74
|
+
"next_page_url": null,
|
75
|
+
"key": "data",
|
76
|
+
"url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations?PageSize=50&Page=0"
|
77
|
+
},
|
78
|
+
"data": [
|
79
|
+
{
|
80
|
+
"sid": "BN0044409f7e067e279523808d267e2d85",
|
81
|
+
"account_sid": "AC78e8e67fc0246521490fb9907fd0c165",
|
82
|
+
"customer_profile_bundle_sid": "BU3344409f7e067e279523808d267e2d85",
|
83
|
+
"a2p_profile_bundle_sid": "BU3344409f7e067e279523808d267e2d85",
|
84
|
+
"date_created": "2021-01-27T14:18:35Z",
|
85
|
+
"date_updated": "2021-01-27T14:18:36Z",
|
86
|
+
"status": "IN_PROGRESS",
|
87
|
+
"tcr_id": "BXXXXXX",
|
88
|
+
"failure_reason": "Registration error",
|
89
|
+
"url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85"
|
90
|
+
}
|
91
|
+
]
|
92
|
+
}
|
93
|
+
]
|
94
|
+
))
|
95
|
+
|
96
|
+
actual = @client.messaging.v1.brand_registrations.list()
|
97
|
+
|
98
|
+
expect(actual).to_not eq(nil)
|
99
|
+
end
|
100
|
+
|
101
|
+
it "can create" do
|
102
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
103
|
+
|
104
|
+
expect {
|
105
|
+
@client.messaging.v1.brand_registrations.create(customer_profile_bundle_sid: 'BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', a2p_profile_bundle_sid: 'BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
|
106
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
107
|
+
|
108
|
+
values = {
|
109
|
+
'CustomerProfileBundleSid' => 'BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
110
|
+
'A2PProfileBundleSid' => 'BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
111
|
+
}
|
112
|
+
expect(
|
113
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
114
|
+
method: 'post',
|
115
|
+
url: 'https://messaging.twilio.com/v1/a2p/BrandRegistrations',
|
116
|
+
data: values,
|
117
|
+
))).to eq(true)
|
118
|
+
end
|
119
|
+
|
120
|
+
it "receives create responses" do
|
121
|
+
@holodeck.mock(Twilio::Response.new(
|
122
|
+
201,
|
123
|
+
%q[
|
124
|
+
{
|
125
|
+
"sid": "BN0044409f7e067e279523808d267e2d85",
|
126
|
+
"account_sid": "AC78e8e67fc0246521490fb9907fd0c165",
|
127
|
+
"customer_profile_bundle_sid": "BU0000009f7e067e279523808d267e2d90",
|
128
|
+
"a2p_profile_bundle_sid": "BU1111109f7e067e279523808d267e2d85",
|
129
|
+
"date_created": "2021-01-28T10:45:51Z",
|
130
|
+
"date_updated": "2021-01-28T10:45:51Z",
|
131
|
+
"status": "PENDING",
|
132
|
+
"tcr_id": "BXXXXXX",
|
133
|
+
"failure_reason": "Registration error",
|
134
|
+
"url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85"
|
135
|
+
}
|
136
|
+
]
|
137
|
+
))
|
138
|
+
|
139
|
+
actual = @client.messaging.v1.brand_registrations.create(customer_profile_bundle_sid: 'BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', a2p_profile_bundle_sid: 'BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
|
140
|
+
|
141
|
+
expect(actual).to_not eq(nil)
|
142
|
+
end
|
143
|
+
end
|
@@ -0,0 +1,194 @@
|
|
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 'Campaign' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.messaging.v1.campaigns('CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').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/a2p/Campaigns/CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
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
|
+
"sid": "CMdeadbeef66043a43b62be6d67c635c85",
|
32
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"date_created": "2021-01-27T14:47:52Z",
|
35
|
+
"date_updated": "2021-01-27T14:47:52Z",
|
36
|
+
"description": "Test description for test campaing",
|
37
|
+
"message_samples": [
|
38
|
+
"Test_Sample_1",
|
39
|
+
"Another_test_sample_2"
|
40
|
+
],
|
41
|
+
"status": "pending",
|
42
|
+
"failure_reason": null,
|
43
|
+
"use_case": "PUBLIC_SERVICE_ANNOUNCEMENT",
|
44
|
+
"has_embedded_links": true,
|
45
|
+
"has_embedded_phone": false,
|
46
|
+
"brand_registration_sid": "BN0044409f7e067e279523808d267e2d85",
|
47
|
+
"url": "https://messaging.twilio.com/v1/a2p/Campaigns/CMdeadbeef66043a43b62be6d67c635c85"
|
48
|
+
}
|
49
|
+
]
|
50
|
+
))
|
51
|
+
|
52
|
+
actual = @client.messaging.v1.campaigns('CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
53
|
+
|
54
|
+
expect(actual).to_not eq(nil)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "can read" do
|
58
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
59
|
+
|
60
|
+
expect {
|
61
|
+
@client.messaging.v1.campaigns.list()
|
62
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
63
|
+
|
64
|
+
expect(
|
65
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
66
|
+
method: 'get',
|
67
|
+
url: 'https://messaging.twilio.com/v1/a2p/Campaigns',
|
68
|
+
))).to eq(true)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "receives read_full responses" do
|
72
|
+
@holodeck.mock(Twilio::Response.new(
|
73
|
+
200,
|
74
|
+
%q[
|
75
|
+
{
|
76
|
+
"meta": {
|
77
|
+
"page": 0,
|
78
|
+
"page_size": 50,
|
79
|
+
"first_page_url": "https://messaging.twilio.com/v1/a2p/Campaigns?PageSize=50&Page=0",
|
80
|
+
"previous_page_url": null,
|
81
|
+
"next_page_url": null,
|
82
|
+
"key": "data",
|
83
|
+
"url": "https://messaging.twilio.com/v1/a2p/Campaigns?PageSize=50&Page=0"
|
84
|
+
},
|
85
|
+
"data": [
|
86
|
+
{
|
87
|
+
"sid": "CMdeadbeef66043a43b62be6d67c635c85",
|
88
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
89
|
+
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
90
|
+
"date_created": "2021-01-27T14:47:52Z",
|
91
|
+
"date_updated": "2021-01-27T14:47:53Z",
|
92
|
+
"description": "Test description for test campaing",
|
93
|
+
"message_samples": [
|
94
|
+
"Test_Sample_1",
|
95
|
+
"Another_test_sample_2"
|
96
|
+
],
|
97
|
+
"status": "pending",
|
98
|
+
"failure_reason": null,
|
99
|
+
"use_case": "GAMBLING_SWEEPSTAKE",
|
100
|
+
"has_embedded_links": true,
|
101
|
+
"has_embedded_phone": false,
|
102
|
+
"brand_registration_sid": "BN0044409f7e067e279523808d267e2d85",
|
103
|
+
"url": "https://messaging.twilio.com/v1/a2p/Campaigns/CMdeadbeef66043a43b62be6d67c635c85"
|
104
|
+
}
|
105
|
+
]
|
106
|
+
}
|
107
|
+
]
|
108
|
+
))
|
109
|
+
|
110
|
+
actual = @client.messaging.v1.campaigns.list()
|
111
|
+
|
112
|
+
expect(actual).to_not eq(nil)
|
113
|
+
end
|
114
|
+
|
115
|
+
it "can create" do
|
116
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
117
|
+
|
118
|
+
expect {
|
119
|
+
@client.messaging.v1.campaigns.create(brand_registration_sid: 'BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', use_case: 'use_case', description: 'description', message_samples: ['message_samples'], has_embedded_links: true, has_embedded_phone: true, messaging_service_sid: 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
|
120
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
121
|
+
|
122
|
+
values = {
|
123
|
+
'BrandRegistrationSid' => 'BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
124
|
+
'UseCase' => 'use_case',
|
125
|
+
'Description' => 'description',
|
126
|
+
'MessageSamples' => Twilio.serialize_list(['message_samples']) { |e| e },
|
127
|
+
'HasEmbeddedLinks' => true,
|
128
|
+
'HasEmbeddedPhone' => true,
|
129
|
+
'MessagingServiceSid' => 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
130
|
+
}
|
131
|
+
expect(
|
132
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
133
|
+
method: 'post',
|
134
|
+
url: 'https://messaging.twilio.com/v1/a2p/Campaigns',
|
135
|
+
data: values,
|
136
|
+
))).to eq(true)
|
137
|
+
end
|
138
|
+
|
139
|
+
it "receives create responses" do
|
140
|
+
@holodeck.mock(Twilio::Response.new(
|
141
|
+
201,
|
142
|
+
%q[
|
143
|
+
{
|
144
|
+
"sid": "CMdeadbeef66043a43b62be6d67c635c85",
|
145
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
146
|
+
"messaging_service_sid": "MG3u3kcgofdljponkatswl3ad3ev0c123u",
|
147
|
+
"brand_registration_sid": "BN0044409f7e067e279523808d267e2d85",
|
148
|
+
"date_created": "2021-01-27T14:47:52Z",
|
149
|
+
"date_updated": "2021-01-27T14:47:52Z",
|
150
|
+
"description": "Send marketing messages about sales and offers to opted in customers.",
|
151
|
+
"message_samples": [
|
152
|
+
"EXPRESS: Denim Days Event is ON",
|
153
|
+
"LAST CHANCE: Book your next flight for just 1 (ONE) EUR"
|
154
|
+
],
|
155
|
+
"status": "pending",
|
156
|
+
"failure_reason": null,
|
157
|
+
"use_case": "2FA",
|
158
|
+
"has_embedded_links": true,
|
159
|
+
"has_embedded_phone": false,
|
160
|
+
"url": "https://messaging.twilio.com/v1/a2p/Campaigns/CMdeadbeef66043a43b62be6d67c635c85"
|
161
|
+
}
|
162
|
+
]
|
163
|
+
))
|
164
|
+
|
165
|
+
actual = @client.messaging.v1.campaigns.create(brand_registration_sid: 'BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', use_case: 'use_case', description: 'description', message_samples: ['message_samples'], has_embedded_links: true, has_embedded_phone: true, messaging_service_sid: 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
|
166
|
+
|
167
|
+
expect(actual).to_not eq(nil)
|
168
|
+
end
|
169
|
+
|
170
|
+
it "can delete" do
|
171
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
172
|
+
|
173
|
+
expect {
|
174
|
+
@client.messaging.v1.campaigns('CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
175
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
176
|
+
|
177
|
+
expect(
|
178
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
179
|
+
method: 'delete',
|
180
|
+
url: 'https://messaging.twilio.com/v1/a2p/Campaigns/CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
181
|
+
))).to eq(true)
|
182
|
+
end
|
183
|
+
|
184
|
+
it "receives delete responses" do
|
185
|
+
@holodeck.mock(Twilio::Response.new(
|
186
|
+
204,
|
187
|
+
nil,
|
188
|
+
))
|
189
|
+
|
190
|
+
actual = @client.messaging.v1.campaigns('CMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
191
|
+
|
192
|
+
expect(actual).to eq(true)
|
193
|
+
end
|
194
|
+
end
|
@@ -0,0 +1,55 @@
|
|
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 'UseCase' do
|
12
|
+
it "can read" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.messaging.v1.use_cases.list()
|
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/a2p/UseCases',
|
23
|
+
))).to eq(true)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "receives read responses" do
|
27
|
+
@holodeck.mock(Twilio::Response.new(
|
28
|
+
200,
|
29
|
+
%q[
|
30
|
+
{
|
31
|
+
"meta": {
|
32
|
+
"page": 0,
|
33
|
+
"page_size": 50,
|
34
|
+
"first_page_url": "https://messaging.twilio.com/v1/a2p/UseCases?PageSize=50&Page=0",
|
35
|
+
"previous_page_url": null,
|
36
|
+
"next_page_url": null,
|
37
|
+
"key": "data",
|
38
|
+
"url": "https://messaging.twilio.com/v1/a2p/UseCases?PageSize=50&Page=0"
|
39
|
+
},
|
40
|
+
"data": [
|
41
|
+
{
|
42
|
+
"code": "HIGHER_EDUCATION",
|
43
|
+
"name": "Higher Education",
|
44
|
+
"description": "Higher Education: For campaigns created on behalf of Colleges or Universities"
|
45
|
+
}
|
46
|
+
]
|
47
|
+
}
|
48
|
+
]
|
49
|
+
))
|
50
|
+
|
51
|
+
actual = @client.messaging.v1.use_cases.list()
|
52
|
+
|
53
|
+
expect(actual).to_not eq(nil)
|
54
|
+
end
|
55
|
+
end
|
@@ -57,15 +57,13 @@ describe 'Document' do
|
|
57
57
|
|
58
58
|
expect {
|
59
59
|
@client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
60
|
-
.documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete(
|
60
|
+
.documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
61
61
|
}.to raise_exception(Twilio::REST::TwilioError)
|
62
62
|
|
63
|
-
headers = {'If-Match' => 'if_match', }
|
64
63
|
expect(
|
65
64
|
@holodeck.has_request?(Holodeck::Request.new(
|
66
65
|
method: 'delete',
|
67
66
|
url: 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
68
|
-
headers: headers,
|
69
67
|
))).to eq(true)
|
70
68
|
end
|
71
69
|
|