twilio-ruby 5.39.1 → 5.40.2
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 +101 -1
- data/CONTRIBUTING.md +2 -2
- data/ISSUE_TEMPLATE.md +5 -1
- data/Makefile +1 -1
- data/PULL_REQUEST_TEMPLATE.md +1 -1
- data/README.md +4 -3
- data/lib/twilio-ruby/framework/version.rb +2 -7
- 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 +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +79 -60
- 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/client.rb +7 -0
- data/lib/twilio-ruby/rest/conversations.rb +52 -0
- data/lib/twilio-ruby/rest/conversations/v1.rb +88 -1
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +258 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +15 -4
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +19 -10
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +12 -2
- data/lib/twilio-ruby/rest/conversations/v1/credential.rb +427 -0
- data/lib/twilio-ruby/rest/conversations/v1/notification.rb +310 -0
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +372 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +385 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +259 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +586 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +546 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +388 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +513 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +454 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +393 -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 +63 -0
- data/lib/twilio-ruby/rest/events/v1.rb +74 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -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 +363 -0
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +322 -0
- 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/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/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 +39 -9
- 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/trunking/v1/trunk.rb +25 -3
- 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 +4 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +0 -6
- 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 +42 -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/configuration_spec.rb +85 -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/notification_spec.rb +107 -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_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/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 +212 -0
- data/spec/integration/events/v1/subscription_spec.rb +205 -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_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 +70 -2
@@ -0,0 +1,107 @@
|
|
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 'Notification' do
|
12
|
+
it "can update" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.conversations.v1.notifications('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
expect(
|
20
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
21
|
+
method: 'post',
|
22
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Configuration/Notifications',
|
23
|
+
))).to eq(true)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "receives update responses" do
|
27
|
+
@holodeck.mock(Twilio::Response.new(
|
28
|
+
200,
|
29
|
+
%q[
|
30
|
+
{
|
31
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
32
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
33
|
+
"log_enabled": true,
|
34
|
+
"added_to_conversation": {
|
35
|
+
"enabled": false,
|
36
|
+
"template": "notifications.added_to_conversation.template",
|
37
|
+
"sound": "ring"
|
38
|
+
},
|
39
|
+
"new_message": {
|
40
|
+
"enabled": false,
|
41
|
+
"template": "notifications.new_message.template",
|
42
|
+
"badge_count_enabled": true,
|
43
|
+
"sound": "ring"
|
44
|
+
},
|
45
|
+
"removed_from_conversation": {
|
46
|
+
"enabled": false,
|
47
|
+
"template": "notifications.removed_from_conversation.template",
|
48
|
+
"sound": "ring"
|
49
|
+
},
|
50
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Notifications"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
))
|
54
|
+
|
55
|
+
actual = @client.conversations.v1.notifications('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
56
|
+
|
57
|
+
expect(actual).to_not eq(nil)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "can fetch" do
|
61
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
62
|
+
|
63
|
+
expect {
|
64
|
+
@client.conversations.v1.notifications('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
65
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
66
|
+
|
67
|
+
expect(
|
68
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
69
|
+
method: 'get',
|
70
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Configuration/Notifications',
|
71
|
+
))).to eq(true)
|
72
|
+
end
|
73
|
+
|
74
|
+
it "receives fetch responses" do
|
75
|
+
@holodeck.mock(Twilio::Response.new(
|
76
|
+
200,
|
77
|
+
%q[
|
78
|
+
{
|
79
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
80
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
81
|
+
"log_enabled": false,
|
82
|
+
"added_to_conversation": {
|
83
|
+
"enabled": true,
|
84
|
+
"template": "notifications.added_to_conversation.template",
|
85
|
+
"sound": "ring"
|
86
|
+
},
|
87
|
+
"new_message": {
|
88
|
+
"enabled": true,
|
89
|
+
"template": "notifications.new_message.template",
|
90
|
+
"badge_count_enabled": false,
|
91
|
+
"sound": "ring"
|
92
|
+
},
|
93
|
+
"removed_from_conversation": {
|
94
|
+
"enabled": true,
|
95
|
+
"template": "notifications.removed_from_conversation.template",
|
96
|
+
"sound": "ring"
|
97
|
+
},
|
98
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration/Notifications"
|
99
|
+
}
|
100
|
+
]
|
101
|
+
))
|
102
|
+
|
103
|
+
actual = @client.conversations.v1.notifications('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
104
|
+
|
105
|
+
expect(actual).to_not eq(nil)
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,249 @@
|
|
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 'Role' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.conversations.v1.roles.create(friendly_name: 'friendly_name', type: 'conversation', permission: ['permission'])
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {
|
20
|
+
'FriendlyName' => 'friendly_name',
|
21
|
+
'Type' => 'conversation',
|
22
|
+
'Permission' => Twilio.serialize_list(['permission']) { |e| e },
|
23
|
+
}
|
24
|
+
expect(
|
25
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
26
|
+
method: 'post',
|
27
|
+
url: 'https://conversations.twilio.com/v1/Roles',
|
28
|
+
data: values,
|
29
|
+
))).to eq(true)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "receives create responses" do
|
33
|
+
@holodeck.mock(Twilio::Response.new(
|
34
|
+
201,
|
35
|
+
%q[
|
36
|
+
{
|
37
|
+
"sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
40
|
+
"friendly_name": "Conversation Role",
|
41
|
+
"type": "conversation",
|
42
|
+
"permissions": [
|
43
|
+
"sendMessage",
|
44
|
+
"leaveConversation",
|
45
|
+
"editOwnMessage",
|
46
|
+
"deleteOwnMessage"
|
47
|
+
],
|
48
|
+
"date_created": "2016-03-03T19:47:15Z",
|
49
|
+
"date_updated": "2016-03-03T19:47:15Z",
|
50
|
+
"url": "https://conversations.twilio.com/v1/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
))
|
54
|
+
|
55
|
+
actual = @client.conversations.v1.roles.create(friendly_name: 'friendly_name', type: 'conversation', permission: ['permission'])
|
56
|
+
|
57
|
+
expect(actual).to_not eq(nil)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "can update" do
|
61
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
62
|
+
|
63
|
+
expect {
|
64
|
+
@client.conversations.v1.roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(permission: ['permission'])
|
65
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
66
|
+
|
67
|
+
values = {'Permission' => Twilio.serialize_list(['permission']) { |e| e }, }
|
68
|
+
expect(
|
69
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
70
|
+
method: 'post',
|
71
|
+
url: 'https://conversations.twilio.com/v1/Roles/RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
72
|
+
data: values,
|
73
|
+
))).to eq(true)
|
74
|
+
end
|
75
|
+
|
76
|
+
it "receives update responses" do
|
77
|
+
@holodeck.mock(Twilio::Response.new(
|
78
|
+
200,
|
79
|
+
%q[
|
80
|
+
{
|
81
|
+
"sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
82
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
83
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
84
|
+
"friendly_name": "Conversation Role",
|
85
|
+
"type": "conversation",
|
86
|
+
"permissions": [
|
87
|
+
"sendMessage",
|
88
|
+
"leaveConversation",
|
89
|
+
"editOwnMessage",
|
90
|
+
"deleteOwnMessage"
|
91
|
+
],
|
92
|
+
"date_created": "2016-03-03T19:47:15Z",
|
93
|
+
"date_updated": "2016-03-03T19:47:15Z",
|
94
|
+
"url": "https://conversations.twilio.com/v1/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
95
|
+
}
|
96
|
+
]
|
97
|
+
))
|
98
|
+
|
99
|
+
actual = @client.conversations.v1.roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(permission: ['permission'])
|
100
|
+
|
101
|
+
expect(actual).to_not eq(nil)
|
102
|
+
end
|
103
|
+
|
104
|
+
it "can delete" do
|
105
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
106
|
+
|
107
|
+
expect {
|
108
|
+
@client.conversations.v1.roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
109
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
110
|
+
|
111
|
+
expect(
|
112
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
113
|
+
method: 'delete',
|
114
|
+
url: 'https://conversations.twilio.com/v1/Roles/RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
115
|
+
))).to eq(true)
|
116
|
+
end
|
117
|
+
|
118
|
+
it "receives delete responses" do
|
119
|
+
@holodeck.mock(Twilio::Response.new(
|
120
|
+
204,
|
121
|
+
nil,
|
122
|
+
))
|
123
|
+
|
124
|
+
actual = @client.conversations.v1.roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
125
|
+
|
126
|
+
expect(actual).to eq(true)
|
127
|
+
end
|
128
|
+
|
129
|
+
it "can fetch" do
|
130
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
131
|
+
|
132
|
+
expect {
|
133
|
+
@client.conversations.v1.roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
134
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
135
|
+
|
136
|
+
expect(
|
137
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
138
|
+
method: 'get',
|
139
|
+
url: 'https://conversations.twilio.com/v1/Roles/RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
140
|
+
))).to eq(true)
|
141
|
+
end
|
142
|
+
|
143
|
+
it "receives fetch responses" do
|
144
|
+
@holodeck.mock(Twilio::Response.new(
|
145
|
+
200,
|
146
|
+
%q[
|
147
|
+
{
|
148
|
+
"sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
149
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
150
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
151
|
+
"friendly_name": "Conversation Role",
|
152
|
+
"type": "conversation",
|
153
|
+
"permissions": [
|
154
|
+
"sendMessage",
|
155
|
+
"leaveConversation",
|
156
|
+
"editOwnMessage",
|
157
|
+
"deleteOwnMessage"
|
158
|
+
],
|
159
|
+
"date_created": "2016-03-03T19:47:15Z",
|
160
|
+
"date_updated": "2016-03-03T19:47:15Z",
|
161
|
+
"url": "https://conversations.twilio.com/v1/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
162
|
+
}
|
163
|
+
]
|
164
|
+
))
|
165
|
+
|
166
|
+
actual = @client.conversations.v1.roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
167
|
+
|
168
|
+
expect(actual).to_not eq(nil)
|
169
|
+
end
|
170
|
+
|
171
|
+
it "can read" do
|
172
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
173
|
+
|
174
|
+
expect {
|
175
|
+
@client.conversations.v1.roles.list()
|
176
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
177
|
+
|
178
|
+
expect(
|
179
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
180
|
+
method: 'get',
|
181
|
+
url: 'https://conversations.twilio.com/v1/Roles',
|
182
|
+
))).to eq(true)
|
183
|
+
end
|
184
|
+
|
185
|
+
it "receives read_full responses" do
|
186
|
+
@holodeck.mock(Twilio::Response.new(
|
187
|
+
200,
|
188
|
+
%q[
|
189
|
+
{
|
190
|
+
"meta": {
|
191
|
+
"page": 0,
|
192
|
+
"page_size": 50,
|
193
|
+
"first_page_url": "https://conversations.twilio.com/v1/Roles?PageSize=50&Page=0",
|
194
|
+
"previous_page_url": null,
|
195
|
+
"url": "https://conversations.twilio.com/v1/Roles?PageSize=50&Page=0",
|
196
|
+
"next_page_url": null,
|
197
|
+
"key": "roles"
|
198
|
+
},
|
199
|
+
"roles": [
|
200
|
+
{
|
201
|
+
"sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
202
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
203
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
204
|
+
"friendly_name": "Conversation Role",
|
205
|
+
"type": "conversation",
|
206
|
+
"permissions": [
|
207
|
+
"sendMessage",
|
208
|
+
"leaveConversation",
|
209
|
+
"editOwnMessage",
|
210
|
+
"deleteOwnMessage"
|
211
|
+
],
|
212
|
+
"date_created": "2016-03-03T19:47:15Z",
|
213
|
+
"date_updated": "2016-03-03T19:47:15Z",
|
214
|
+
"url": "https://conversations.twilio.com/v1/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
215
|
+
}
|
216
|
+
]
|
217
|
+
}
|
218
|
+
]
|
219
|
+
))
|
220
|
+
|
221
|
+
actual = @client.conversations.v1.roles.list()
|
222
|
+
|
223
|
+
expect(actual).to_not eq(nil)
|
224
|
+
end
|
225
|
+
|
226
|
+
it "receives read_empty responses" do
|
227
|
+
@holodeck.mock(Twilio::Response.new(
|
228
|
+
200,
|
229
|
+
%q[
|
230
|
+
{
|
231
|
+
"meta": {
|
232
|
+
"page": 0,
|
233
|
+
"page_size": 50,
|
234
|
+
"first_page_url": "https://conversations.twilio.com/v1/Roles?PageSize=50&Page=0",
|
235
|
+
"previous_page_url": null,
|
236
|
+
"url": "https://conversations.twilio.com/v1/Roles?PageSize=50&Page=0",
|
237
|
+
"next_page_url": null,
|
238
|
+
"key": "roles"
|
239
|
+
},
|
240
|
+
"roles": []
|
241
|
+
}
|
242
|
+
]
|
243
|
+
))
|
244
|
+
|
245
|
+
actual = @client.conversations.v1.roles.list()
|
246
|
+
|
247
|
+
expect(actual).to_not eq(nil)
|
248
|
+
end
|
249
|
+
end
|
@@ -0,0 +1,166 @@
|
|
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 'Binding' do
|
12
|
+
it "can delete" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
17
|
+
.bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
18
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
19
|
+
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'delete',
|
23
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings/BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives delete responses" do
|
28
|
+
@holodeck.mock(Twilio::Response.new(
|
29
|
+
204,
|
30
|
+
nil,
|
31
|
+
))
|
32
|
+
|
33
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
34
|
+
.bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
35
|
+
|
36
|
+
expect(actual).to eq(true)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "can fetch" do
|
40
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
41
|
+
|
42
|
+
expect {
|
43
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
44
|
+
.bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
45
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
46
|
+
|
47
|
+
expect(
|
48
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
49
|
+
method: 'get',
|
50
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings/BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
51
|
+
))).to eq(true)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "receives fetch responses" do
|
55
|
+
@holodeck.mock(Twilio::Response.new(
|
56
|
+
200,
|
57
|
+
%q[
|
58
|
+
{
|
59
|
+
"sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
60
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
61
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
62
|
+
"date_created": "2016-10-21T11:37:03Z",
|
63
|
+
"date_updated": "2016-10-21T11:37:03Z",
|
64
|
+
"endpoint": "TestUser-endpoint",
|
65
|
+
"identity": "TestUser",
|
66
|
+
"binding_type": "gcm",
|
67
|
+
"credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
68
|
+
"message_types": [
|
69
|
+
"removed_from_conversation",
|
70
|
+
"new_message",
|
71
|
+
"added_to_conversation"
|
72
|
+
],
|
73
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
74
|
+
}
|
75
|
+
]
|
76
|
+
))
|
77
|
+
|
78
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
79
|
+
.bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
80
|
+
|
81
|
+
expect(actual).to_not eq(nil)
|
82
|
+
end
|
83
|
+
|
84
|
+
it "can read" do
|
85
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
86
|
+
|
87
|
+
expect {
|
88
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
89
|
+
.bindings.list()
|
90
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
91
|
+
|
92
|
+
expect(
|
93
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
94
|
+
method: 'get',
|
95
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings',
|
96
|
+
))).to eq(true)
|
97
|
+
end
|
98
|
+
|
99
|
+
it "receives read_full responses" do
|
100
|
+
@holodeck.mock(Twilio::Response.new(
|
101
|
+
200,
|
102
|
+
%q[
|
103
|
+
{
|
104
|
+
"meta": {
|
105
|
+
"page": 0,
|
106
|
+
"page_size": 50,
|
107
|
+
"first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0",
|
108
|
+
"previous_page_url": null,
|
109
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0",
|
110
|
+
"next_page_url": null,
|
111
|
+
"key": "bindings"
|
112
|
+
},
|
113
|
+
"bindings": [
|
114
|
+
{
|
115
|
+
"sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
116
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
117
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
118
|
+
"date_created": "2016-10-21T11:37:03Z",
|
119
|
+
"date_updated": "2016-10-21T11:37:03Z",
|
120
|
+
"endpoint": "TestUser-endpoint",
|
121
|
+
"identity": "TestUser",
|
122
|
+
"binding_type": "gcm",
|
123
|
+
"credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
124
|
+
"message_types": [
|
125
|
+
"removed_from_conversation",
|
126
|
+
"new_message",
|
127
|
+
"added_to_conversation"
|
128
|
+
],
|
129
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
130
|
+
}
|
131
|
+
]
|
132
|
+
}
|
133
|
+
]
|
134
|
+
))
|
135
|
+
|
136
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
137
|
+
.bindings.list()
|
138
|
+
|
139
|
+
expect(actual).to_not eq(nil)
|
140
|
+
end
|
141
|
+
|
142
|
+
it "receives read_empty responses" do
|
143
|
+
@holodeck.mock(Twilio::Response.new(
|
144
|
+
200,
|
145
|
+
%q[
|
146
|
+
{
|
147
|
+
"meta": {
|
148
|
+
"page": 0,
|
149
|
+
"page_size": 50,
|
150
|
+
"first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0",
|
151
|
+
"previous_page_url": null,
|
152
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0",
|
153
|
+
"next_page_url": null,
|
154
|
+
"key": "bindings"
|
155
|
+
},
|
156
|
+
"bindings": []
|
157
|
+
}
|
158
|
+
]
|
159
|
+
))
|
160
|
+
|
161
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
162
|
+
.bindings.list()
|
163
|
+
|
164
|
+
expect(actual).to_not eq(nil)
|
165
|
+
end
|
166
|
+
end
|