twilio-ruby 5.46.0 → 5.50.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 +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
@@ -0,0 +1,255 @@
|
|
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 'CustomerProfiles' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.trusthub.v1.customer_profiles.create(friendly_name: 'friendly_name', email: 'email', policy_sid: 'RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {
|
20
|
+
'FriendlyName' => 'friendly_name',
|
21
|
+
'Email' => 'email',
|
22
|
+
'PolicySid' => 'RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
23
|
+
}
|
24
|
+
expect(
|
25
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
26
|
+
method: 'post',
|
27
|
+
url: 'https://trusthub.twilio.com/v1/CustomerProfiles',
|
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": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
+
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
40
|
+
"friendly_name": "friendly_name",
|
41
|
+
"status": "draft",
|
42
|
+
"email": "email",
|
43
|
+
"status_callback": "http://www.example.com",
|
44
|
+
"valid_until": null,
|
45
|
+
"date_created": "2019-07-30T22:29:24Z",
|
46
|
+
"date_updated": "2019-07-31T01:09:00Z",
|
47
|
+
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
48
|
+
"links": {
|
49
|
+
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
|
50
|
+
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
|
51
|
+
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
|
52
|
+
}
|
53
|
+
}
|
54
|
+
]
|
55
|
+
))
|
56
|
+
|
57
|
+
actual = @client.trusthub.v1.customer_profiles.create(friendly_name: 'friendly_name', email: 'email', policy_sid: 'RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
|
58
|
+
|
59
|
+
expect(actual).to_not eq(nil)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "can read" do
|
63
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
64
|
+
|
65
|
+
expect {
|
66
|
+
@client.trusthub.v1.customer_profiles.list()
|
67
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
68
|
+
|
69
|
+
expect(
|
70
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
71
|
+
method: 'get',
|
72
|
+
url: 'https://trusthub.twilio.com/v1/CustomerProfiles',
|
73
|
+
))).to eq(true)
|
74
|
+
end
|
75
|
+
|
76
|
+
it "receives read_empty responses" do
|
77
|
+
@holodeck.mock(Twilio::Response.new(
|
78
|
+
200,
|
79
|
+
%q[
|
80
|
+
{
|
81
|
+
"results": [],
|
82
|
+
"meta": {
|
83
|
+
"page": 0,
|
84
|
+
"page_size": 50,
|
85
|
+
"first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles?PageSize=50&Page=0",
|
86
|
+
"previous_page_url": null,
|
87
|
+
"url": "https://trusthub.twilio.com/v1/CustomerProfiles?PageSize=50&Page=0",
|
88
|
+
"next_page_url": null,
|
89
|
+
"key": "results"
|
90
|
+
}
|
91
|
+
}
|
92
|
+
]
|
93
|
+
))
|
94
|
+
|
95
|
+
actual = @client.trusthub.v1.customer_profiles.list()
|
96
|
+
|
97
|
+
expect(actual).to_not eq(nil)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "receives read_full responses" do
|
101
|
+
@holodeck.mock(Twilio::Response.new(
|
102
|
+
200,
|
103
|
+
%q[
|
104
|
+
{
|
105
|
+
"results": [
|
106
|
+
{
|
107
|
+
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
108
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
109
|
+
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
110
|
+
"friendly_name": "friendly_name",
|
111
|
+
"status": "provisionally-approved",
|
112
|
+
"email": "email",
|
113
|
+
"status_callback": "http://www.example.com",
|
114
|
+
"valid_until": "2020-07-31T01:00:00Z",
|
115
|
+
"date_created": "2019-07-30T22:29:24Z",
|
116
|
+
"date_updated": "2019-07-31T01:09:00Z",
|
117
|
+
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
118
|
+
"links": {
|
119
|
+
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
|
120
|
+
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
|
121
|
+
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
|
122
|
+
}
|
123
|
+
}
|
124
|
+
],
|
125
|
+
"meta": {
|
126
|
+
"page": 0,
|
127
|
+
"page_size": 50,
|
128
|
+
"first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
|
129
|
+
"previous_page_url": null,
|
130
|
+
"url": "https://trusthub.twilio.com/v1/CustomerProfiles?Status=draft&FriendlyName=friendly_name&PolicySid=RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
|
131
|
+
"next_page_url": null,
|
132
|
+
"key": "results"
|
133
|
+
}
|
134
|
+
}
|
135
|
+
]
|
136
|
+
))
|
137
|
+
|
138
|
+
actual = @client.trusthub.v1.customer_profiles.list()
|
139
|
+
|
140
|
+
expect(actual).to_not eq(nil)
|
141
|
+
end
|
142
|
+
|
143
|
+
it "can fetch" do
|
144
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
145
|
+
|
146
|
+
expect {
|
147
|
+
@client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
148
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
149
|
+
|
150
|
+
expect(
|
151
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
152
|
+
method: 'get',
|
153
|
+
url: 'https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
154
|
+
))).to eq(true)
|
155
|
+
end
|
156
|
+
|
157
|
+
it "receives fetch responses" do
|
158
|
+
@holodeck.mock(Twilio::Response.new(
|
159
|
+
200,
|
160
|
+
%q[
|
161
|
+
{
|
162
|
+
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
163
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
164
|
+
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
165
|
+
"friendly_name": "friendly_name",
|
166
|
+
"status": "draft",
|
167
|
+
"valid_until": null,
|
168
|
+
"email": "email",
|
169
|
+
"status_callback": "http://www.example.com",
|
170
|
+
"date_created": "2019-07-30T22:29:24Z",
|
171
|
+
"date_updated": "2019-07-31T01:09:00Z",
|
172
|
+
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
173
|
+
"links": {
|
174
|
+
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
|
175
|
+
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
|
176
|
+
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
|
177
|
+
}
|
178
|
+
}
|
179
|
+
]
|
180
|
+
))
|
181
|
+
|
182
|
+
actual = @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
183
|
+
|
184
|
+
expect(actual).to_not eq(nil)
|
185
|
+
end
|
186
|
+
|
187
|
+
it "can update" do
|
188
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
189
|
+
|
190
|
+
expect {
|
191
|
+
@client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
192
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
193
|
+
|
194
|
+
expect(
|
195
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
196
|
+
method: 'post',
|
197
|
+
url: 'https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
198
|
+
))).to eq(true)
|
199
|
+
end
|
200
|
+
|
201
|
+
it "receives update responses" do
|
202
|
+
@holodeck.mock(Twilio::Response.new(
|
203
|
+
200,
|
204
|
+
%q[
|
205
|
+
{
|
206
|
+
"sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
207
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
208
|
+
"policy_sid": "RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
209
|
+
"friendly_name": "friendly_name",
|
210
|
+
"status": "draft",
|
211
|
+
"email": "email",
|
212
|
+
"status_callback": "http://www.example.com",
|
213
|
+
"valid_until": null,
|
214
|
+
"date_created": "2019-07-30T22:29:24Z",
|
215
|
+
"date_updated": "2019-07-31T01:09:00Z",
|
216
|
+
"url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
217
|
+
"links": {
|
218
|
+
"customer_profiles_entity_assignments": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/EntityAssignments",
|
219
|
+
"customer_profiles_evaluations": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Evaluations",
|
220
|
+
"customer_profiles_channel_endpoint_assignment": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments"
|
221
|
+
}
|
222
|
+
}
|
223
|
+
]
|
224
|
+
))
|
225
|
+
|
226
|
+
actual = @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
227
|
+
|
228
|
+
expect(actual).to_not eq(nil)
|
229
|
+
end
|
230
|
+
|
231
|
+
it "can delete" do
|
232
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
233
|
+
|
234
|
+
expect {
|
235
|
+
@client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
236
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
237
|
+
|
238
|
+
expect(
|
239
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
240
|
+
method: 'delete',
|
241
|
+
url: 'https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
242
|
+
))).to eq(true)
|
243
|
+
end
|
244
|
+
|
245
|
+
it "receives delete responses" do
|
246
|
+
@holodeck.mock(Twilio::Response.new(
|
247
|
+
204,
|
248
|
+
nil,
|
249
|
+
))
|
250
|
+
|
251
|
+
actual = @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
252
|
+
|
253
|
+
expect(actual).to eq(true)
|
254
|
+
end
|
255
|
+
end
|
@@ -0,0 +1,247 @@
|
|
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 'EndUser' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.trusthub.v1.end_users.create(friendly_name: 'friendly_name', type: 'type')
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {'FriendlyName' => 'friendly_name', 'Type' => 'type', }
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'post',
|
23
|
+
url: 'https://trusthub.twilio.com/v1/EndUsers',
|
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
|
+
"date_updated": "2021-02-16T20:40:57Z",
|
34
|
+
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
+
"friendly_name": "auth_rep_1",
|
36
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"date_created": "2021-02-16T20:40:57Z",
|
39
|
+
"attributes": {
|
40
|
+
"phone_number": "+11234567890",
|
41
|
+
"job_position": "CEO",
|
42
|
+
"first_name": "rep1",
|
43
|
+
"last_name": "test",
|
44
|
+
"business_title": "ceo",
|
45
|
+
"email": "foobar@test.com"
|
46
|
+
},
|
47
|
+
"type": "authorized_representative_1"
|
48
|
+
}
|
49
|
+
]
|
50
|
+
))
|
51
|
+
|
52
|
+
actual = @client.trusthub.v1.end_users.create(friendly_name: 'friendly_name', type: 'type')
|
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.trusthub.v1.end_users.list()
|
62
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
63
|
+
|
64
|
+
expect(
|
65
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
66
|
+
method: 'get',
|
67
|
+
url: 'https://trusthub.twilio.com/v1/EndUsers',
|
68
|
+
))).to eq(true)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "receives read_empty responses" do
|
72
|
+
@holodeck.mock(Twilio::Response.new(
|
73
|
+
200,
|
74
|
+
%q[
|
75
|
+
{
|
76
|
+
"results": [],
|
77
|
+
"meta": {
|
78
|
+
"page": 0,
|
79
|
+
"page_size": 50,
|
80
|
+
"first_page_url": "https://trusthub.twilio.com/v1/EndUsers?PageSize=50&Page=0",
|
81
|
+
"previous_page_url": null,
|
82
|
+
"url": "https://trusthub.twilio.com/v1/EndUsers?PageSize=50&Page=0",
|
83
|
+
"next_page_url": null,
|
84
|
+
"key": "results"
|
85
|
+
}
|
86
|
+
}
|
87
|
+
]
|
88
|
+
))
|
89
|
+
|
90
|
+
actual = @client.trusthub.v1.end_users.list()
|
91
|
+
|
92
|
+
expect(actual).to_not eq(nil)
|
93
|
+
end
|
94
|
+
|
95
|
+
it "receives read_full responses" do
|
96
|
+
@holodeck.mock(Twilio::Response.new(
|
97
|
+
200,
|
98
|
+
%q[
|
99
|
+
{
|
100
|
+
"results": [
|
101
|
+
{
|
102
|
+
"date_updated": "2021-02-16T20:40:57Z",
|
103
|
+
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
104
|
+
"friendly_name": "auth_rep_1",
|
105
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
106
|
+
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
107
|
+
"date_created": "2021-02-16T20:40:57Z",
|
108
|
+
"attributes": {
|
109
|
+
"phone_number": "+11234567890",
|
110
|
+
"job_position": "CEO",
|
111
|
+
"first_name": "rep1",
|
112
|
+
"last_name": "test",
|
113
|
+
"business_title": "ceo",
|
114
|
+
"email": "foobar@test.com"
|
115
|
+
},
|
116
|
+
"type": "authorized_representative_1"
|
117
|
+
}
|
118
|
+
],
|
119
|
+
"meta": {
|
120
|
+
"page": 0,
|
121
|
+
"page_size": 50,
|
122
|
+
"first_page_url": "https://trusthub.twilio.com/v1/EndUsers?PageSize=50&Page=0",
|
123
|
+
"previous_page_url": null,
|
124
|
+
"url": "https://trusthub.twilio.com/v1/EndUsers?PageSize=50&Page=0",
|
125
|
+
"next_page_url": null,
|
126
|
+
"key": "results"
|
127
|
+
}
|
128
|
+
}
|
129
|
+
]
|
130
|
+
))
|
131
|
+
|
132
|
+
actual = @client.trusthub.v1.end_users.list()
|
133
|
+
|
134
|
+
expect(actual).to_not eq(nil)
|
135
|
+
end
|
136
|
+
|
137
|
+
it "can fetch" do
|
138
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
139
|
+
|
140
|
+
expect {
|
141
|
+
@client.trusthub.v1.end_users('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
142
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
143
|
+
|
144
|
+
expect(
|
145
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
146
|
+
method: 'get',
|
147
|
+
url: 'https://trusthub.twilio.com/v1/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
148
|
+
))).to eq(true)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "receives fetch responses" do
|
152
|
+
@holodeck.mock(Twilio::Response.new(
|
153
|
+
200,
|
154
|
+
%q[
|
155
|
+
{
|
156
|
+
"date_updated": "2021-02-16T20:40:57Z",
|
157
|
+
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
158
|
+
"friendly_name": "auth_rep_1",
|
159
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
160
|
+
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
161
|
+
"date_created": "2021-02-16T20:40:57Z",
|
162
|
+
"attributes": {
|
163
|
+
"phone_number": "+11234567890",
|
164
|
+
"job_position": "CEO",
|
165
|
+
"first_name": "rep1",
|
166
|
+
"last_name": "test",
|
167
|
+
"business_title": "ceo",
|
168
|
+
"email": "foobar@test.com"
|
169
|
+
},
|
170
|
+
"type": "authorized_representative_1"
|
171
|
+
}
|
172
|
+
]
|
173
|
+
))
|
174
|
+
|
175
|
+
actual = @client.trusthub.v1.end_users('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
176
|
+
|
177
|
+
expect(actual).to_not eq(nil)
|
178
|
+
end
|
179
|
+
|
180
|
+
it "can update" do
|
181
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
182
|
+
|
183
|
+
expect {
|
184
|
+
@client.trusthub.v1.end_users('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
185
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
186
|
+
|
187
|
+
expect(
|
188
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
189
|
+
method: 'post',
|
190
|
+
url: 'https://trusthub.twilio.com/v1/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
191
|
+
))).to eq(true)
|
192
|
+
end
|
193
|
+
|
194
|
+
it "receives update responses" do
|
195
|
+
@holodeck.mock(Twilio::Response.new(
|
196
|
+
200,
|
197
|
+
%q[
|
198
|
+
{
|
199
|
+
"date_updated": "2021-02-16T20:40:57Z",
|
200
|
+
"sid": "ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
201
|
+
"friendly_name": "friendly_name",
|
202
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
203
|
+
"url": "https://trusthub.twilio.com/v1/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
204
|
+
"date_created": "2021-02-16T20:40:57Z",
|
205
|
+
"attributes": {
|
206
|
+
"phone_number": "+11234567890",
|
207
|
+
"job_position": "CEO",
|
208
|
+
"first_name": "rep1",
|
209
|
+
"last_name": "test",
|
210
|
+
"business_title": "ceo",
|
211
|
+
"email": "foobar@test.com"
|
212
|
+
},
|
213
|
+
"type": "authorized_representative_1"
|
214
|
+
}
|
215
|
+
]
|
216
|
+
))
|
217
|
+
|
218
|
+
actual = @client.trusthub.v1.end_users('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
219
|
+
|
220
|
+
expect(actual).to_not eq(nil)
|
221
|
+
end
|
222
|
+
|
223
|
+
it "can delete" do
|
224
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
225
|
+
|
226
|
+
expect {
|
227
|
+
@client.trusthub.v1.end_users('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
228
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
229
|
+
|
230
|
+
expect(
|
231
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
232
|
+
method: 'delete',
|
233
|
+
url: 'https://trusthub.twilio.com/v1/EndUsers/ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
234
|
+
))).to eq(true)
|
235
|
+
end
|
236
|
+
|
237
|
+
it "receives delete responses" do
|
238
|
+
@holodeck.mock(Twilio::Response.new(
|
239
|
+
204,
|
240
|
+
nil,
|
241
|
+
))
|
242
|
+
|
243
|
+
actual = @client.trusthub.v1.end_users('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
244
|
+
|
245
|
+
expect(actual).to eq(true)
|
246
|
+
end
|
247
|
+
end
|