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
@@ -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
|
]
|
@@ -0,0 +1,85 @@
|
|
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
|
+
}
|
40
|
+
}
|
41
|
+
]
|
42
|
+
))
|
43
|
+
|
44
|
+
actual = @client.conversations.v1.configuration().fetch()
|
45
|
+
|
46
|
+
expect(actual).to_not eq(nil)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "can update" do
|
50
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
51
|
+
|
52
|
+
expect {
|
53
|
+
@client.conversations.v1.configuration().update()
|
54
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
55
|
+
|
56
|
+
expect(
|
57
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
58
|
+
method: 'post',
|
59
|
+
url: 'https://conversations.twilio.com/v1/Configuration',
|
60
|
+
))).to eq(true)
|
61
|
+
end
|
62
|
+
|
63
|
+
it "receives update responses" do
|
64
|
+
@holodeck.mock(Twilio::Response.new(
|
65
|
+
200,
|
66
|
+
%q[
|
67
|
+
{
|
68
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
69
|
+
"default_chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
|
+
"default_messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
71
|
+
"default_inactive_timer": "PT1M",
|
72
|
+
"default_closed_timer": "PT10M",
|
73
|
+
"url": "https://conversations.twilio.com/v1/Configuration",
|
74
|
+
"links": {
|
75
|
+
"service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration"
|
76
|
+
}
|
77
|
+
}
|
78
|
+
]
|
79
|
+
))
|
80
|
+
|
81
|
+
actual = @client.conversations.v1.configuration().update()
|
82
|
+
|
83
|
+
expect(actual).to_not eq(nil)
|
84
|
+
end
|
85
|
+
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
|
|
@@ -34,7 +34,7 @@ describe 'Participant' do
|
|
34
34
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
35
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
36
|
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
-
"identity":
|
37
|
+
"identity": null,
|
38
38
|
"attributes": "{ \\"role\\": \\"driver\\" }",
|
39
39
|
"messaging_binding": {
|
40
40
|
"type": "sms",
|
@@ -108,6 +108,62 @@ describe 'Participant' do
|
|
108
108
|
expect(actual).to_not eq(nil)
|
109
109
|
end
|
110
110
|
|
111
|
+
it "receives create_gmms_chat_no_attributes responses" do
|
112
|
+
@holodeck.mock(Twilio::Response.new(
|
113
|
+
201,
|
114
|
+
%q[
|
115
|
+
{
|
116
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
117
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
118
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
119
|
+
"identity": "IDENTITY",
|
120
|
+
"attributes": "{}",
|
121
|
+
"messaging_binding": {
|
122
|
+
"type": "sms",
|
123
|
+
"projected_address": "+15017122661"
|
124
|
+
},
|
125
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
126
|
+
"date_created": "2020-07-01T22:18:37Z",
|
127
|
+
"date_updated": "2020-07-01T22:18:37Z",
|
128
|
+
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
129
|
+
}
|
130
|
+
]
|
131
|
+
))
|
132
|
+
|
133
|
+
actual = @client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
134
|
+
.participants.create()
|
135
|
+
|
136
|
+
expect(actual).to_not eq(nil)
|
137
|
+
end
|
138
|
+
|
139
|
+
it "receives create_gmms_sms_no_attributes responses" do
|
140
|
+
@holodeck.mock(Twilio::Response.new(
|
141
|
+
201,
|
142
|
+
%q[
|
143
|
+
{
|
144
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
145
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
146
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
147
|
+
"identity": null,
|
148
|
+
"attributes": "{}",
|
149
|
+
"messaging_binding": {
|
150
|
+
"type": "sms",
|
151
|
+
"address": "+15017122661"
|
152
|
+
},
|
153
|
+
"role_sid": null,
|
154
|
+
"date_created": "2020-07-01T22:18:37Z",
|
155
|
+
"date_updated": "2020-07-01T22:18:37Z",
|
156
|
+
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
157
|
+
}
|
158
|
+
]
|
159
|
+
))
|
160
|
+
|
161
|
+
actual = @client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
162
|
+
.participants.create()
|
163
|
+
|
164
|
+
expect(actual).to_not eq(nil)
|
165
|
+
end
|
166
|
+
|
111
167
|
it "can update" do
|
112
168
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
113
169
|
|
@@ -133,7 +189,7 @@ describe 'Participant' do
|
|
133
189
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
134
190
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
135
191
|
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
136
|
-
"identity":
|
192
|
+
"identity": null,
|
137
193
|
"attributes": "{ \\"role\\": \\"driver\\" }",
|
138
194
|
"messaging_binding": {
|
139
195
|
"type": "sms",
|
@@ -234,7 +290,7 @@ describe 'Participant' do
|
|
234
290
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
235
291
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
236
292
|
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
237
|
-
"identity":
|
293
|
+
"identity": null,
|
238
294
|
"attributes": "{ \\"role\\": \\"driver\\" }",
|
239
295
|
"messaging_binding": {
|
240
296
|
"type": "sms",
|
@@ -289,7 +345,7 @@ describe 'Participant' do
|
|
289
345
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
290
346
|
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
291
347
|
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
292
|
-
"identity":
|
348
|
+
"identity": null,
|
293
349
|
"attributes": "{ \\"role\\": \\"driver\\" }",
|
294
350
|
"messaging_binding": {
|
295
351
|
"type": "sms",
|
@@ -35,6 +35,7 @@ describe 'Conversation' do
|
|
35
35
|
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
36
|
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
37
|
"friendly_name": "friendly_name",
|
38
|
+
"unique_name": "unique_name",
|
38
39
|
"attributes": "{ \\"topic\\": \\"feedback\\" }",
|
39
40
|
"date_created": "2015-12-16T22:18:37Z",
|
40
41
|
"date_updated": "2015-12-16T22:18:38Z",
|
@@ -58,6 +59,37 @@ describe 'Conversation' do
|
|
58
59
|
expect(actual).to_not eq(nil)
|
59
60
|
end
|
60
61
|
|
62
|
+
it "receives create_no_timers_no_attributes responses" do
|
63
|
+
@holodeck.mock(Twilio::Response.new(
|
64
|
+
201,
|
65
|
+
%q[
|
66
|
+
{
|
67
|
+
"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
68
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
69
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
|
+
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
71
|
+
"friendly_name": "friendly_name",
|
72
|
+
"unique_name": null,
|
73
|
+
"attributes": "{}",
|
74
|
+
"date_created": "2020-07-01T22:18:37Z",
|
75
|
+
"date_updated": "2020-07-01T22:18:37Z",
|
76
|
+
"state": "active",
|
77
|
+
"timers": {},
|
78
|
+
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
79
|
+
"links": {
|
80
|
+
"participants": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants",
|
81
|
+
"messages": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
|
82
|
+
"webhooks": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks"
|
83
|
+
}
|
84
|
+
}
|
85
|
+
]
|
86
|
+
))
|
87
|
+
|
88
|
+
actual = @client.conversations.v1.conversations.create()
|
89
|
+
|
90
|
+
expect(actual).to_not eq(nil)
|
91
|
+
end
|
92
|
+
|
61
93
|
it "can update" do
|
62
94
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
63
95
|
|
@@ -84,6 +116,7 @@ describe 'Conversation' do
|
|
84
116
|
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
85
117
|
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",
|
86
118
|
"friendly_name": "friendly_name",
|
119
|
+
"unique_name": null,
|
87
120
|
"attributes": "{ \\"topic\\": \\"feedback\\" }",
|
88
121
|
"date_created": "2015-12-16T22:18:37Z",
|
89
122
|
"date_updated": "2015-12-16T22:18:38Z",
|
@@ -158,6 +191,7 @@ describe 'Conversation' do
|
|
158
191
|
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
159
192
|
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
160
193
|
"friendly_name": "My First Conversation",
|
194
|
+
"unique_name": "first_conversation",
|
161
195
|
"attributes": "{ \\"topic\\": \\"feedback\\" }",
|
162
196
|
"date_created": "2015-12-16T22:18:37Z",
|
163
197
|
"date_updated": "2015-12-16T22:18:38Z",
|
@@ -207,6 +241,7 @@ describe 'Conversation' do
|
|
207
241
|
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
208
242
|
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
209
243
|
"friendly_name": "Home Repair Visit",
|
244
|
+
"unique_name": null,
|
210
245
|
"attributes": "{ \\"topic\\": \\"feedback\\" }",
|
211
246
|
"date_created": "2015-12-16T22:18:37Z",
|
212
247
|
"date_updated": "2015-12-16T22:18:38Z",
|
@@ -0,0 +1,219 @@
|
|
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 'Credential' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.conversations.v1.credentials.create(type: 'apn')
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {'Type' => 'apn', }
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'post',
|
23
|
+
url: 'https://conversations.twilio.com/v1/Credentials',
|
24
|
+
data: values,
|
25
|
+
))).to eq(true)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "receives create responses" do
|
29
|
+
@holodeck.mock(Twilio::Response.new(
|
30
|
+
201,
|
31
|
+
%q[
|
32
|
+
{
|
33
|
+
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
34
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
+
"friendly_name": "Test slow create",
|
36
|
+
"type": "apn",
|
37
|
+
"sandbox": "False",
|
38
|
+
"date_created": "2015-10-07T17:50:01Z",
|
39
|
+
"date_updated": "2015-10-07T17:50:01Z",
|
40
|
+
"url": "https://conversations.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
41
|
+
}
|
42
|
+
]
|
43
|
+
))
|
44
|
+
|
45
|
+
actual = @client.conversations.v1.credentials.create(type: 'apn')
|
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.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').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/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
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
|
+
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
71
|
+
"friendly_name": "Test slow create",
|
72
|
+
"type": "apn",
|
73
|
+
"sandbox": "False",
|
74
|
+
"date_created": "2015-10-07T17:50:01Z",
|
75
|
+
"date_updated": "2015-10-07T17:50:01Z",
|
76
|
+
"url": "https://conversations.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
77
|
+
}
|
78
|
+
]
|
79
|
+
))
|
80
|
+
|
81
|
+
actual = @client.conversations.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
82
|
+
|
83
|
+
expect(actual).to_not eq(nil)
|
84
|
+
end
|
85
|
+
|
86
|
+
it "can delete" do
|
87
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
88
|
+
|
89
|
+
expect {
|
90
|
+
@client.conversations.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
91
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
92
|
+
|
93
|
+
expect(
|
94
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
95
|
+
method: 'delete',
|
96
|
+
url: 'https://conversations.twilio.com/v1/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
97
|
+
))).to eq(true)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "receives delete responses" do
|
101
|
+
@holodeck.mock(Twilio::Response.new(
|
102
|
+
204,
|
103
|
+
nil,
|
104
|
+
))
|
105
|
+
|
106
|
+
actual = @client.conversations.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
107
|
+
|
108
|
+
expect(actual).to eq(true)
|
109
|
+
end
|
110
|
+
|
111
|
+
it "can fetch" do
|
112
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
113
|
+
|
114
|
+
expect {
|
115
|
+
@client.conversations.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
116
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
117
|
+
|
118
|
+
expect(
|
119
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
120
|
+
method: 'get',
|
121
|
+
url: 'https://conversations.twilio.com/v1/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
122
|
+
))).to eq(true)
|
123
|
+
end
|
124
|
+
|
125
|
+
it "receives fetch responses" do
|
126
|
+
@holodeck.mock(Twilio::Response.new(
|
127
|
+
200,
|
128
|
+
%q[
|
129
|
+
{
|
130
|
+
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
131
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
132
|
+
"friendly_name": "Test slow create",
|
133
|
+
"type": "apn",
|
134
|
+
"sandbox": "False",
|
135
|
+
"date_created": "2015-10-07T17:50:01Z",
|
136
|
+
"date_updated": "2015-10-07T17:50:01Z",
|
137
|
+
"url": "https://conversations.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
138
|
+
}
|
139
|
+
]
|
140
|
+
))
|
141
|
+
|
142
|
+
actual = @client.conversations.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
143
|
+
|
144
|
+
expect(actual).to_not eq(nil)
|
145
|
+
end
|
146
|
+
|
147
|
+
it "can read" do
|
148
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
149
|
+
|
150
|
+
expect {
|
151
|
+
@client.conversations.v1.credentials.list()
|
152
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
153
|
+
|
154
|
+
expect(
|
155
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
156
|
+
method: 'get',
|
157
|
+
url: 'https://conversations.twilio.com/v1/Credentials',
|
158
|
+
))).to eq(true)
|
159
|
+
end
|
160
|
+
|
161
|
+
it "receives read_full responses" do
|
162
|
+
@holodeck.mock(Twilio::Response.new(
|
163
|
+
200,
|
164
|
+
%q[
|
165
|
+
{
|
166
|
+
"credentials": [
|
167
|
+
{
|
168
|
+
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
169
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
170
|
+
"friendly_name": "Test slow create",
|
171
|
+
"type": "apn",
|
172
|
+
"sandbox": "False",
|
173
|
+
"date_created": "2015-10-07T17:50:01Z",
|
174
|
+
"date_updated": "2015-10-07T17:50:01Z",
|
175
|
+
"url": "https://conversations.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
176
|
+
}
|
177
|
+
],
|
178
|
+
"meta": {
|
179
|
+
"page": 0,
|
180
|
+
"page_size": 50,
|
181
|
+
"first_page_url": "https://conversations.twilio.com/v1/Credentials?PageSize=50&Page=0",
|
182
|
+
"previous_page_url": null,
|
183
|
+
"url": "https://conversations.twilio.com/v1/Credentials?PageSize=50&Page=0",
|
184
|
+
"next_page_url": null,
|
185
|
+
"key": "credentials"
|
186
|
+
}
|
187
|
+
}
|
188
|
+
]
|
189
|
+
))
|
190
|
+
|
191
|
+
actual = @client.conversations.v1.credentials.list()
|
192
|
+
|
193
|
+
expect(actual).to_not eq(nil)
|
194
|
+
end
|
195
|
+
|
196
|
+
it "receives read_empty responses" do
|
197
|
+
@holodeck.mock(Twilio::Response.new(
|
198
|
+
200,
|
199
|
+
%q[
|
200
|
+
{
|
201
|
+
"credentials": [],
|
202
|
+
"meta": {
|
203
|
+
"page": 0,
|
204
|
+
"page_size": 50,
|
205
|
+
"first_page_url": "https://conversations.twilio.com/v1/Credentials?PageSize=50&Page=0",
|
206
|
+
"previous_page_url": null,
|
207
|
+
"url": "https://conversations.twilio.com/v1/Credentials?PageSize=50&Page=0",
|
208
|
+
"next_page_url": null,
|
209
|
+
"key": "credentials"
|
210
|
+
}
|
211
|
+
}
|
212
|
+
]
|
213
|
+
))
|
214
|
+
|
215
|
+
actual = @client.conversations.v1.credentials.list()
|
216
|
+
|
217
|
+
expect(actual).to_not eq(nil)
|
218
|
+
end
|
219
|
+
end
|