twilio-ruby 5.46.0 → 5.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +112 -0
- data/README.md +20 -6
- data/lib/twilio-ruby/rest/api.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010.rb +5 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +10 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +4 -4
- data/lib/twilio-ruby/rest/autopilot/v1.rb +5 -4
- data/lib/twilio-ruby/rest/bulkexports/v1.rb +10 -8
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +14 -0
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +14 -0
- data/lib/twilio-ruby/rest/chat/v1.rb +10 -8
- data/lib/twilio-ruby/rest/chat/v2.rb +10 -8
- data/lib/twilio-ruby/rest/client.rb +8 -1
- data/lib/twilio-ruby/rest/conversations/v1.rb +25 -20
- data/lib/twilio-ruby/rest/events/v1.rb +20 -16
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +4 -4
- data/lib/twilio-ruby/rest/events/v1/schema.rb +4 -4
- data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +4 -4
- data/lib/twilio-ruby/rest/events/v1/sink.rb +6 -5
- data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +3 -3
- data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +3 -3
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +15 -8
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +133 -6
- data/lib/twilio-ruby/rest/fax/v1.rb +5 -4
- data/lib/twilio-ruby/rest/flex_api/v1.rb +15 -12
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
- data/lib/twilio-ruby/rest/insights.rb +1 -1
- data/lib/twilio-ruby/rest/insights/v1.rb +11 -9
- data/lib/twilio-ruby/rest/insights/v1/room.rb +55 -43
- data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +22 -22
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +10 -8
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +10 -8
- data/lib/twilio-ruby/rest/lookups/v1.rb +5 -4
- data/lib/twilio-ruby/rest/messaging.rb +8 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +21 -4
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +328 -0
- data/lib/twilio-ruby/rest/monitor/v1.rb +10 -8
- data/lib/twilio-ruby/rest/notify/v1.rb +10 -8
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +10 -8
- data/lib/twilio-ruby/rest/preview/deployed_devices.rb +5 -4
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +10 -8
- data/lib/twilio-ruby/rest/preview/marketplace.rb +10 -8
- data/lib/twilio-ruby/rest/preview/sync.rb +5 -4
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +4 -8
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +5 -4
- data/lib/twilio-ruby/rest/preview/understand.rb +5 -4
- data/lib/twilio-ruby/rest/preview/wireless.rb +15 -12
- data/lib/twilio-ruby/rest/proxy/v1.rb +5 -4
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -1
- data/lib/twilio-ruby/rest/serverless/v1.rb +5 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +11 -1
- data/lib/twilio-ruby/rest/studio/v1.rb +5 -4
- data/lib/twilio-ruby/rest/studio/v2.rb +5 -4
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +4 -12
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -9
- data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +10 -16
- data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +6 -11
- data/lib/twilio-ruby/rest/supersim.rb +9 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +41 -20
- data/lib/twilio-ruby/rest/supersim/v1/command.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +86 -13
- data/lib/twilio-ruby/rest/supersim/v1/network.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +371 -0
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +3 -3
- data/lib/twilio-ruby/rest/sync/v1.rb +5 -4
- data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +13 -32
- 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 +9 -23
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +38 -45
- 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 +9 -23
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +38 -47
- 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 +9 -23
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +0 -6
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +5 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +12 -8
- data/lib/twilio-ruby/rest/trunking/v1.rb +5 -4
- data/lib/twilio-ruby/rest/trusthub.rb +100 -0
- data/lib/twilio-ruby/rest/trusthub/v1.rb +146 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +523 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb +359 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +330 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb +328 -0
- data/lib/twilio-ruby/rest/trusthub/v1/end_user.rb +356 -0
- data/lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb +271 -0
- data/lib/twilio-ruby/rest/trusthub/v1/policies.rb +262 -0
- data/lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb +369 -0
- data/lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb +271 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +523 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb +359 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +330 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb +328 -0
- data/lib/twilio-ruby/rest/verify.rb +9 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +26 -8
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +4 -3
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +64 -13
- data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +329 -0
- data/lib/twilio-ruby/rest/video/v1.rb +20 -16
- data/lib/twilio-ruby/rest/video/v1/room.rb +4 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +0 -6
- data/lib/twilio-ruby/rest/voice/v1.rb +20 -16
- data/lib/twilio-ruby/rest/wireless/v1.rb +15 -12
- data/lib/twilio-ruby/twiml/voice_response.rb +38 -8
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/conference_spec.rb +302 -44
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +4 -16
- data/spec/integration/api/v2010/account/message_spec.rb +37 -0
- data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +6 -2
- data/spec/integration/bulkexports/v1/export/job_spec.rb +3 -1
- data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +134 -0
- 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/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 +20 -0
- data/spec/integration/supersim/v1/sms_command_spec.rb +184 -0
- data/spec/integration/sync/v1/service/document_spec.rb +1 -3
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +3 -1
- data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment_spec.rb +192 -0
- data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_entity_assignments_spec.rb +186 -0
- data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_evaluations_spec.rb +615 -0
- data/spec/integration/trusthub/v1/customer_profiles_spec.rb +255 -0
- data/spec/integration/trusthub/v1/end_user_spec.rb +247 -0
- data/spec/integration/trusthub/v1/end_user_type_spec.rb +176 -0
- data/spec/integration/trusthub/v1/policies_spec.rb +252 -0
- data/spec/integration/trusthub/v1/supporting_document_spec.rb +235 -0
- data/spec/integration/trusthub/v1/supporting_document_type_spec.rb +159 -0
- data/spec/integration/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment_spec.rb +192 -0
- data/spec/integration/trusthub/v1/trust_products/trust_products_entity_assignments_spec.rb +186 -0
- data/spec/integration/trusthub/v1/trust_products/trust_products_evaluations_spec.rb +615 -0
- data/spec/integration/trusthub/v1/trust_products_spec.rb +255 -0
- data/spec/integration/verify/v2/service/entity/factor_spec.rb +3 -3
- data/spec/integration/verify/v2/verification_attempt_spec.rb +146 -0
- data/spec/integration/video/v1/room_spec.rb +39 -0
- metadata +52 -2
@@ -68,10 +68,7 @@ describe 'IncomingPhoneNumber' do
|
|
68
68
|
"status": "in-use",
|
69
69
|
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
70
|
"subresource_uris": {
|
71
|
-
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
|
72
|
-
"local": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json",
|
73
|
-
"mobile": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json",
|
74
|
-
"toll_free": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json"
|
71
|
+
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
|
75
72
|
}
|
76
73
|
}
|
77
74
|
]
|
@@ -142,10 +139,7 @@ describe 'IncomingPhoneNumber' do
|
|
142
139
|
"status": "in-use",
|
143
140
|
"bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
144
141
|
"subresource_uris": {
|
145
|
-
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
|
146
|
-
"local": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json",
|
147
|
-
"mobile": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json",
|
148
|
-
"toll_free": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json"
|
142
|
+
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
|
149
143
|
}
|
150
144
|
}
|
151
145
|
]
|
@@ -247,10 +241,7 @@ describe 'IncomingPhoneNumber' do
|
|
247
241
|
"voice_receive_mode": "voice",
|
248
242
|
"status": "in-use",
|
249
243
|
"subresource_uris": {
|
250
|
-
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
|
251
|
-
"local": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json",
|
252
|
-
"mobile": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json",
|
253
|
-
"toll_free": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json"
|
244
|
+
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
|
254
245
|
}
|
255
246
|
}
|
256
247
|
],
|
@@ -353,10 +344,7 @@ describe 'IncomingPhoneNumber' do
|
|
353
344
|
"voice_receive_mode": "voice",
|
354
345
|
"status": "in-use",
|
355
346
|
"subresource_uris": {
|
356
|
-
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
|
357
|
-
"local": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json",
|
358
|
-
"mobile": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json",
|
359
|
-
"toll_free": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json"
|
347
|
+
"assigned_add_ons": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json"
|
360
348
|
}
|
361
349
|
}
|
362
350
|
]
|
@@ -137,6 +137,43 @@ describe 'Message' do
|
|
137
137
|
expect(actual).to_not eq(nil)
|
138
138
|
end
|
139
139
|
|
140
|
+
it "receives create_with_queued_status responses" do
|
141
|
+
@holodeck.mock(Twilio::Response.new(
|
142
|
+
201,
|
143
|
+
%q[
|
144
|
+
{
|
145
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
146
|
+
"api_version": "2010-04-01",
|
147
|
+
"body": "Hello! \ud83d\udc4d",
|
148
|
+
"date_created": "Thu, 30 Jul 2015 20:12:31 +0000",
|
149
|
+
"date_sent": "Thu, 30 Jul 2015 20:12:33 +0000",
|
150
|
+
"date_updated": "Thu, 30 Jul 2015 20:12:33 +0000",
|
151
|
+
"direction": "outbound-api",
|
152
|
+
"error_code": null,
|
153
|
+
"error_message": null,
|
154
|
+
"from": "+14155552345",
|
155
|
+
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
156
|
+
"num_media": "0",
|
157
|
+
"num_segments": "1",
|
158
|
+
"price": null,
|
159
|
+
"price_unit": null,
|
160
|
+
"sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
161
|
+
"status": "queued",
|
162
|
+
"subresource_uris": {
|
163
|
+
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json"
|
164
|
+
},
|
165
|
+
"to": "+14155552345",
|
166
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
167
|
+
}
|
168
|
+
]
|
169
|
+
))
|
170
|
+
|
171
|
+
actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
172
|
+
.messages.create(to: '+15558675310')
|
173
|
+
|
174
|
+
expect(actual).to_not eq(nil)
|
175
|
+
end
|
176
|
+
|
140
177
|
it "can delete" do
|
141
178
|
@holodeck.mock(Twilio::Response.new(500, ''))
|
142
179
|
|
@@ -73,7 +73,9 @@ describe 'ExportCustomJob' do
|
|
73
73
|
"end_day": "end_day",
|
74
74
|
"webhook_url": "webhook_url",
|
75
75
|
"email": "email",
|
76
|
-
"resource_type": "resource_type"
|
76
|
+
"resource_type": "resource_type",
|
77
|
+
"job_queue_position": "1",
|
78
|
+
"estimated_completion_time": "2021-03-15T20:20:14.547"
|
77
79
|
}
|
78
80
|
]
|
79
81
|
}
|
@@ -116,7 +118,9 @@ describe 'ExportCustomJob' do
|
|
116
118
|
"end_day": "end_day",
|
117
119
|
"webhook_url": "webhook_url",
|
118
120
|
"email": "email",
|
119
|
-
"resource_type": "resource_type"
|
121
|
+
"resource_type": "resource_type",
|
122
|
+
"job_queue_position": "1",
|
123
|
+
"estimated_completion_time": "2021-03-15T20:20:14.547"
|
120
124
|
}
|
121
125
|
]
|
122
126
|
))
|
@@ -38,7 +38,9 @@ describe 'Job' do
|
|
38
38
|
"webhook_url": "webhook_url",
|
39
39
|
"webhook_method": "webhook_method",
|
40
40
|
"email": "email",
|
41
|
-
"resource_type": "resource_type"
|
41
|
+
"resource_type": "resource_type",
|
42
|
+
"job_queue_position": "1",
|
43
|
+
"estimated_completion_time": "2021-03-15T20:20:14.547"
|
42
44
|
}
|
43
45
|
]
|
44
46
|
))
|
@@ -88,4 +88,138 @@ describe 'SubscribedEvent' do
|
|
88
88
|
|
89
89
|
expect(actual).to_not eq(nil)
|
90
90
|
end
|
91
|
+
|
92
|
+
it "can create" do
|
93
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
94
|
+
|
95
|
+
expect {
|
96
|
+
@client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
97
|
+
.subscribed_events.create(type: 'type')
|
98
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
99
|
+
|
100
|
+
values = {'Type' => 'type', }
|
101
|
+
expect(
|
102
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
103
|
+
method: 'post',
|
104
|
+
url: 'https://events.twilio.com/v1/Subscriptions/DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribedEvents',
|
105
|
+
data: values,
|
106
|
+
))).to eq(true)
|
107
|
+
end
|
108
|
+
|
109
|
+
it "receives create responses" do
|
110
|
+
@holodeck.mock(Twilio::Response.new(
|
111
|
+
201,
|
112
|
+
%q[
|
113
|
+
{
|
114
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
115
|
+
"subscription_sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
116
|
+
"type": "event.type",
|
117
|
+
"version": 2,
|
118
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents/event.type"
|
119
|
+
}
|
120
|
+
]
|
121
|
+
))
|
122
|
+
|
123
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
124
|
+
.subscribed_events.create(type: 'type')
|
125
|
+
|
126
|
+
expect(actual).to_not eq(nil)
|
127
|
+
end
|
128
|
+
|
129
|
+
it "can fetch" do
|
130
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
131
|
+
|
132
|
+
expect {
|
133
|
+
@client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
134
|
+
.subscribed_events('type').fetch()
|
135
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
136
|
+
|
137
|
+
expect(
|
138
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
139
|
+
method: 'get',
|
140
|
+
url: 'https://events.twilio.com/v1/Subscriptions/DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribedEvents/type',
|
141
|
+
))).to eq(true)
|
142
|
+
end
|
143
|
+
|
144
|
+
it "receives fetch responses" do
|
145
|
+
@holodeck.mock(Twilio::Response.new(
|
146
|
+
200,
|
147
|
+
%q[
|
148
|
+
{
|
149
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
150
|
+
"subscription_sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
151
|
+
"type": "event.type",
|
152
|
+
"version": 2,
|
153
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents/event.type"
|
154
|
+
}
|
155
|
+
]
|
156
|
+
))
|
157
|
+
|
158
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
159
|
+
.subscribed_events('type').fetch()
|
160
|
+
|
161
|
+
expect(actual).to_not eq(nil)
|
162
|
+
end
|
163
|
+
|
164
|
+
it "can update" do
|
165
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
166
|
+
|
167
|
+
expect {
|
168
|
+
@client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
169
|
+
.subscribed_events('type').update()
|
170
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
171
|
+
|
172
|
+
expect(
|
173
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
174
|
+
method: 'post',
|
175
|
+
url: 'https://events.twilio.com/v1/Subscriptions/DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribedEvents/type',
|
176
|
+
))).to eq(true)
|
177
|
+
end
|
178
|
+
|
179
|
+
it "receives update responses" do
|
180
|
+
@holodeck.mock(Twilio::Response.new(
|
181
|
+
200,
|
182
|
+
%q[
|
183
|
+
{
|
184
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
185
|
+
"subscription_sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
186
|
+
"type": "event.type",
|
187
|
+
"version": 2,
|
188
|
+
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents/event.type"
|
189
|
+
}
|
190
|
+
]
|
191
|
+
))
|
192
|
+
|
193
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
194
|
+
.subscribed_events('type').update()
|
195
|
+
|
196
|
+
expect(actual).to_not eq(nil)
|
197
|
+
end
|
198
|
+
|
199
|
+
it "can delete" do
|
200
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
201
|
+
|
202
|
+
expect {
|
203
|
+
@client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
204
|
+
.subscribed_events('type').delete()
|
205
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
206
|
+
|
207
|
+
expect(
|
208
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
209
|
+
method: 'delete',
|
210
|
+
url: 'https://events.twilio.com/v1/Subscriptions/DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribedEvents/type',
|
211
|
+
))).to eq(true)
|
212
|
+
end
|
213
|
+
|
214
|
+
it "receives delete responses" do
|
215
|
+
@holodeck.mock(Twilio::Response.new(
|
216
|
+
204,
|
217
|
+
nil,
|
218
|
+
))
|
219
|
+
|
220
|
+
actual = @client.events.v1.subscriptions('DFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
221
|
+
.subscribed_events('type').delete()
|
222
|
+
|
223
|
+
expect(actual).to eq(true)
|
224
|
+
end
|
91
225
|
end
|
@@ -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": "PENDING",
|
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": "APPROVED",
|
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
|