twilio-ruby 5.47.0 → 5.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +17 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/client.rb +7 -0
  5. data/lib/twilio-ruby/rest/events/v1/subscription.rb +2 -2
  6. data/lib/twilio-ruby/rest/messaging.rb +0 -14
  7. data/lib/twilio-ruby/rest/messaging/v1.rb +0 -22
  8. data/lib/twilio-ruby/rest/trusthub.rb +100 -0
  9. data/lib/twilio-ruby/rest/trusthub/v1.rb +139 -0
  10. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +523 -0
  11. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb +359 -0
  12. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +330 -0
  13. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb +328 -0
  14. data/lib/twilio-ruby/rest/trusthub/v1/end_user.rb +356 -0
  15. data/lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb +271 -0
  16. data/lib/twilio-ruby/rest/{messaging/v1/use_case.rb → trusthub/v1/policies.rb} +110 -46
  17. data/lib/twilio-ruby/rest/{messaging/v1/campaign.rb → trusthub/v1/supporting_document.rb} +125 -143
  18. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb +271 -0
  19. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +523 -0
  20. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb +359 -0
  21. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +330 -0
  22. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb +328 -0
  23. data/lib/twilio-ruby/rest/verify.rb +9 -0
  24. data/lib/twilio-ruby/rest/verify/v2.rb +15 -0
  25. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +329 -0
  26. data/lib/twilio-ruby/version.rb +1 -1
  27. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +4 -16
  28. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment_spec.rb +192 -0
  29. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_entity_assignments_spec.rb +186 -0
  30. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_evaluations_spec.rb +615 -0
  31. data/spec/integration/trusthub/v1/customer_profiles_spec.rb +255 -0
  32. data/spec/integration/trusthub/v1/end_user_spec.rb +247 -0
  33. data/spec/integration/trusthub/v1/end_user_type_spec.rb +176 -0
  34. data/spec/integration/trusthub/v1/policies_spec.rb +252 -0
  35. data/spec/integration/trusthub/v1/supporting_document_spec.rb +235 -0
  36. data/spec/integration/trusthub/v1/supporting_document_type_spec.rb +159 -0
  37. data/spec/integration/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment_spec.rb +192 -0
  38. data/spec/integration/trusthub/v1/trust_products/trust_products_entity_assignments_spec.rb +186 -0
  39. data/spec/integration/trusthub/v1/trust_products/trust_products_evaluations_spec.rb +615 -0
  40. data/spec/integration/trusthub/v1/trust_products_spec.rb +255 -0
  41. data/spec/integration/verify/v2/verification_attempt_spec.rb +146 -0
  42. metadata +46 -8
  43. data/spec/integration/messaging/v1/campaign_spec.rb +0 -194
  44. data/spec/integration/messaging/v1/use_case_spec.rb +0 -55
@@ -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