twilio-ruby 5.45.0 → 5.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGES.md +104 -0
  4. data/LICENSE +1 -1
  5. data/README.md +16 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +1 -1
  7. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +12 -12
  8. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +13 -13
  9. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +1 -1
  10. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +8 -8
  11. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +15 -15
  12. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +3 -3
  13. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -5
  14. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +6 -3
  15. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +1 -1
  16. data/lib/twilio-ruby/rest/bulkexports.rb +4 -2
  17. data/lib/twilio-ruby/rest/bulkexports/v1.rb +4 -2
  18. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +7 -4
  19. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +7 -4
  20. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +5 -3
  21. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +5 -3
  22. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +5 -3
  23. data/lib/twilio-ruby/rest/chat/v1/service.rb +5 -5
  24. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +6 -6
  25. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +3 -3
  26. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +3 -3
  27. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +9 -9
  28. data/lib/twilio-ruby/rest/chat/v2/service.rb +5 -5
  29. data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +7 -7
  30. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +6 -6
  31. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +3 -3
  32. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +3 -3
  33. data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +27 -24
  34. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +9 -9
  35. data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +10 -10
  36. data/lib/twilio-ruby/rest/client.rb +7 -0
  37. data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +9 -9
  38. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
  39. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +32 -2
  40. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +9 -9
  41. data/lib/twilio-ruby/rest/conversations/v1/role.rb +9 -9
  42. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +7 -7
  43. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +17 -2
  44. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
  45. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +32 -2
  46. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +9 -9
  47. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +9 -9
  48. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +8 -1
  49. data/lib/twilio-ruby/rest/conversations/v1/user.rb +8 -1
  50. data/lib/twilio-ruby/rest/events/v1/sink.rb +4 -2
  51. data/lib/twilio-ruby/rest/events/v1/subscription.rb +3 -2
  52. data/lib/twilio-ruby/rest/flex_api.rb +1 -1
  53. data/lib/twilio-ruby/rest/flex_api/v1.rb +1 -1
  54. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +5 -5
  55. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +18 -4
  56. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +88 -76
  57. data/lib/twilio-ruby/rest/flex_api/v1/web_channel.rb +2 -2
  58. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +8 -9
  59. data/lib/twilio-ruby/rest/insights/v1/room.rb +7 -7
  60. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
  61. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +3 -3
  62. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +3 -3
  63. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +3 -3
  64. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +3 -3
  65. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +4 -4
  66. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +3 -3
  67. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +7 -7
  68. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +3 -3
  69. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +3 -3
  70. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +3 -3
  71. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +6 -6
  72. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +4 -4
  73. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +4 -4
  74. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +16 -16
  75. data/lib/twilio-ruby/rest/messaging.rb +8 -0
  76. data/lib/twilio-ruby/rest/messaging/v1.rb +15 -0
  77. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +328 -0
  78. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +1 -1
  79. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +1 -1
  80. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +1 -1
  81. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +16 -15
  82. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +18 -18
  83. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +1 -1
  84. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb +1 -1
  85. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb +1 -1
  86. data/lib/twilio-ruby/rest/preview.rb +4 -2
  87. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +4 -2
  88. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +7 -4
  89. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +7 -4
  90. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +5 -3
  91. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +5 -3
  92. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +5 -3
  93. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +13 -13
  94. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  95. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +8 -8
  96. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +4 -8
  97. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +2 -2
  98. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +2 -2
  99. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +1 -1
  100. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +2 -2
  101. data/lib/twilio-ruby/rest/pricing/v2/voice/country.rb +2 -2
  102. data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +1 -1
  103. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +1 -1
  104. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +1 -1
  105. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +17 -7
  106. data/lib/twilio-ruby/rest/studio/v2/flow.rb +6 -14
  107. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +0 -8
  108. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +0 -8
  109. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +0 -8
  110. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +0 -8
  111. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +2 -10
  112. data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +10 -16
  113. data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +6 -11
  114. data/lib/twilio-ruby/rest/supersim/v1/command.rb +4 -4
  115. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +33 -12
  116. data/lib/twilio-ruby/rest/supersim/v1/network.rb +5 -5
  117. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +6 -6
  118. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +5 -5
  119. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +4 -4
  120. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +3 -3
  121. data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -8
  122. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +16 -36
  123. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -8
  124. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +9 -25
  125. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +24 -43
  126. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -8
  127. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +9 -25
  128. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +25 -44
  129. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +1 -9
  130. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +5 -23
  131. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +1 -7
  132. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +17 -17
  133. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +10 -10
  134. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +1 -1
  135. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +10 -10
  136. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +1 -1
  137. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  138. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +1 -1
  139. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +1 -1
  140. data/lib/twilio-ruby/rest/trusthub.rb +100 -0
  141. data/lib/twilio-ruby/rest/trusthub/v1.rb +139 -0
  142. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +523 -0
  143. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb +359 -0
  144. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +330 -0
  145. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb +328 -0
  146. data/lib/twilio-ruby/rest/trusthub/v1/end_user.rb +356 -0
  147. data/lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb +271 -0
  148. data/lib/twilio-ruby/rest/trusthub/v1/policies.rb +262 -0
  149. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb +369 -0
  150. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb +271 -0
  151. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +523 -0
  152. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb +359 -0
  153. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +330 -0
  154. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb +328 -0
  155. data/lib/twilio-ruby/rest/verify.rb +9 -0
  156. data/lib/twilio-ruby/rest/verify/v2.rb +15 -0
  157. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +3 -3
  158. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  159. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +10 -10
  160. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +329 -0
  161. data/lib/twilio-ruby/rest/video/v1/composition.rb +16 -15
  162. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +26 -26
  163. data/lib/twilio-ruby/rest/video/v1/recording.rb +6 -6
  164. data/lib/twilio-ruby/rest/video/v1/room.rb +10 -3
  165. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +1 -1
  166. data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +1 -1
  167. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +1 -1
  168. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -4
  169. data/lib/twilio-ruby/twiml/voice_response.rb +17 -8
  170. data/lib/twilio-ruby/version.rb +1 -1
  171. data/spec/integration/api/v2010/account/conference_spec.rb +302 -44
  172. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +4 -16
  173. data/spec/integration/conversations/v1/conversation/participant_spec.rb +30 -10
  174. data/spec/integration/conversations/v1/service/configuration_spec.rb +2 -0
  175. data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +30 -10
  176. data/spec/integration/conversations/v1/service/user_spec.rb +9 -4
  177. data/spec/integration/conversations/v1/user_spec.rb +9 -4
  178. data/spec/integration/events/v1/sink_spec.rb +14 -0
  179. data/spec/integration/flex_api/v1/configuration_spec.rb +24 -0
  180. data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
  181. data/spec/integration/messaging/v1/brand_registration_spec.rb +143 -0
  182. data/spec/integration/preview/sync/service/document_spec.rb +1 -3
  183. data/spec/integration/serverless/v1/service/build_spec.rb +12 -2
  184. data/spec/integration/supersim/v1/fleet_spec.rb +8 -0
  185. data/spec/integration/sync/v1/service/document_spec.rb +1 -3
  186. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment_spec.rb +192 -0
  187. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_entity_assignments_spec.rb +186 -0
  188. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_evaluations_spec.rb +615 -0
  189. data/spec/integration/trusthub/v1/customer_profiles_spec.rb +255 -0
  190. data/spec/integration/trusthub/v1/end_user_spec.rb +247 -0
  191. data/spec/integration/trusthub/v1/end_user_type_spec.rb +176 -0
  192. data/spec/integration/trusthub/v1/policies_spec.rb +252 -0
  193. data/spec/integration/trusthub/v1/supporting_document_spec.rb +235 -0
  194. data/spec/integration/trusthub/v1/supporting_document_type_spec.rb +159 -0
  195. data/spec/integration/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment_spec.rb +192 -0
  196. data/spec/integration/trusthub/v1/trust_products/trust_products_entity_assignments_spec.rb +186 -0
  197. data/spec/integration/trusthub/v1/trust_products/trust_products_evaluations_spec.rb +615 -0
  198. data/spec/integration/trusthub/v1/trust_products_spec.rb +255 -0
  199. data/spec/integration/verify/v2/verification_attempt_spec.rb +146 -0
  200. data/spec/integration/video/v1/room_spec.rb +5 -0
  201. data/spec/twiml/voice_response_spec.rb +1 -1
  202. metadata +49 -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