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.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +112 -0
  3. data/README.md +20 -6
  4. data/lib/twilio-ruby/rest/api.rb +1 -1
  5. data/lib/twilio-ruby/rest/api/v2010.rb +5 -4
  6. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +10 -1
  7. data/lib/twilio-ruby/rest/api/v2010/account/call/event.rb +4 -4
  8. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +4 -4
  9. data/lib/twilio-ruby/rest/autopilot/v1.rb +5 -4
  10. data/lib/twilio-ruby/rest/bulkexports/v1.rb +10 -8
  11. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +14 -0
  12. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +14 -0
  13. data/lib/twilio-ruby/rest/chat/v1.rb +10 -8
  14. data/lib/twilio-ruby/rest/chat/v2.rb +10 -8
  15. data/lib/twilio-ruby/rest/client.rb +8 -1
  16. data/lib/twilio-ruby/rest/conversations/v1.rb +25 -20
  17. data/lib/twilio-ruby/rest/events/v1.rb +20 -16
  18. data/lib/twilio-ruby/rest/events/v1/event_type.rb +4 -4
  19. data/lib/twilio-ruby/rest/events/v1/schema.rb +4 -4
  20. data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +4 -4
  21. data/lib/twilio-ruby/rest/events/v1/sink.rb +6 -5
  22. data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +3 -3
  23. data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +3 -3
  24. data/lib/twilio-ruby/rest/events/v1/subscription.rb +15 -8
  25. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +133 -6
  26. data/lib/twilio-ruby/rest/fax/v1.rb +5 -4
  27. data/lib/twilio-ruby/rest/flex_api/v1.rb +15 -12
  28. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
  29. data/lib/twilio-ruby/rest/insights.rb +1 -1
  30. data/lib/twilio-ruby/rest/insights/v1.rb +11 -9
  31. data/lib/twilio-ruby/rest/insights/v1/room.rb +55 -43
  32. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +22 -22
  33. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +10 -8
  34. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +10 -8
  35. data/lib/twilio-ruby/rest/lookups/v1.rb +5 -4
  36. data/lib/twilio-ruby/rest/messaging.rb +8 -0
  37. data/lib/twilio-ruby/rest/messaging/v1.rb +21 -4
  38. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +328 -0
  39. data/lib/twilio-ruby/rest/monitor/v1.rb +10 -8
  40. data/lib/twilio-ruby/rest/notify/v1.rb +10 -8
  41. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +10 -8
  42. data/lib/twilio-ruby/rest/preview/deployed_devices.rb +5 -4
  43. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +10 -8
  44. data/lib/twilio-ruby/rest/preview/marketplace.rb +10 -8
  45. data/lib/twilio-ruby/rest/preview/sync.rb +5 -4
  46. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +4 -8
  47. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +5 -4
  48. data/lib/twilio-ruby/rest/preview/understand.rb +5 -4
  49. data/lib/twilio-ruby/rest/preview/wireless.rb +15 -12
  50. data/lib/twilio-ruby/rest/proxy/v1.rb +5 -4
  51. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -1
  52. data/lib/twilio-ruby/rest/serverless/v1.rb +5 -4
  53. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +11 -1
  54. data/lib/twilio-ruby/rest/studio/v1.rb +5 -4
  55. data/lib/twilio-ruby/rest/studio/v2.rb +5 -4
  56. data/lib/twilio-ruby/rest/studio/v2/flow.rb +4 -12
  57. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +0 -8
  58. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +0 -8
  59. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +0 -8
  60. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +0 -8
  61. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -9
  62. data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +10 -16
  63. data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +6 -11
  64. data/lib/twilio-ruby/rest/supersim.rb +9 -0
  65. data/lib/twilio-ruby/rest/supersim/v1.rb +41 -20
  66. data/lib/twilio-ruby/rest/supersim/v1/command.rb +4 -4
  67. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +86 -13
  68. data/lib/twilio-ruby/rest/supersim/v1/network.rb +4 -4
  69. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +4 -4
  70. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +4 -4
  71. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +4 -4
  72. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +371 -0
  73. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +3 -3
  74. data/lib/twilio-ruby/rest/sync/v1.rb +5 -4
  75. data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -8
  76. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +13 -32
  77. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -8
  78. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +9 -23
  79. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +38 -45
  80. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -8
  81. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +9 -23
  82. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +38 -47
  83. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +0 -8
  84. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +9 -23
  85. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +0 -6
  86. data/lib/twilio-ruby/rest/taskrouter/v1.rb +5 -4
  87. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +12 -8
  88. data/lib/twilio-ruby/rest/trunking/v1.rb +5 -4
  89. data/lib/twilio-ruby/rest/trusthub.rb +100 -0
  90. data/lib/twilio-ruby/rest/trusthub/v1.rb +146 -0
  91. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +523 -0
  92. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb +359 -0
  93. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +330 -0
  94. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb +328 -0
  95. data/lib/twilio-ruby/rest/trusthub/v1/end_user.rb +356 -0
  96. data/lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb +271 -0
  97. data/lib/twilio-ruby/rest/trusthub/v1/policies.rb +262 -0
  98. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb +369 -0
  99. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb +271 -0
  100. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +523 -0
  101. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb +359 -0
  102. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +330 -0
  103. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb +328 -0
  104. data/lib/twilio-ruby/rest/verify.rb +9 -0
  105. data/lib/twilio-ruby/rest/verify/v2.rb +26 -8
  106. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +4 -3
  107. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +64 -13
  108. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +329 -0
  109. data/lib/twilio-ruby/rest/video/v1.rb +20 -16
  110. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -1
  111. data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +0 -6
  112. data/lib/twilio-ruby/rest/voice/v1.rb +20 -16
  113. data/lib/twilio-ruby/rest/wireless/v1.rb +15 -12
  114. data/lib/twilio-ruby/twiml/voice_response.rb +38 -8
  115. data/lib/twilio-ruby/version.rb +1 -1
  116. data/spec/integration/api/v2010/account/conference_spec.rb +302 -44
  117. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +4 -16
  118. data/spec/integration/api/v2010/account/message_spec.rb +37 -0
  119. data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +6 -2
  120. data/spec/integration/bulkexports/v1/export/job_spec.rb +3 -1
  121. data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +134 -0
  122. data/spec/integration/flex_api/v1/configuration_spec.rb +24 -0
  123. data/spec/integration/messaging/v1/brand_registration_spec.rb +143 -0
  124. data/spec/integration/preview/sync/service/document_spec.rb +1 -3
  125. data/spec/integration/serverless/v1/service/build_spec.rb +12 -2
  126. data/spec/integration/supersim/v1/fleet_spec.rb +20 -0
  127. data/spec/integration/supersim/v1/sms_command_spec.rb +184 -0
  128. data/spec/integration/sync/v1/service/document_spec.rb +1 -3
  129. data/spec/integration/taskrouter/v1/workspace/task_spec.rb +3 -1
  130. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment_spec.rb +192 -0
  131. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_entity_assignments_spec.rb +186 -0
  132. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_evaluations_spec.rb +615 -0
  133. data/spec/integration/trusthub/v1/customer_profiles_spec.rb +255 -0
  134. data/spec/integration/trusthub/v1/end_user_spec.rb +247 -0
  135. data/spec/integration/trusthub/v1/end_user_type_spec.rb +176 -0
  136. data/spec/integration/trusthub/v1/policies_spec.rb +252 -0
  137. data/spec/integration/trusthub/v1/supporting_document_spec.rb +235 -0
  138. data/spec/integration/trusthub/v1/supporting_document_type_spec.rb +159 -0
  139. data/spec/integration/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment_spec.rb +192 -0
  140. data/spec/integration/trusthub/v1/trust_products/trust_products_entity_assignments_spec.rb +186 -0
  141. data/spec/integration/trusthub/v1/trust_products/trust_products_evaluations_spec.rb +615 -0
  142. data/spec/integration/trusthub/v1/trust_products_spec.rb +255 -0
  143. data/spec/integration/verify/v2/service/entity/factor_spec.rb +3 -3
  144. data/spec/integration/verify/v2/verification_attempt_spec.rb +146 -0
  145. data/spec/integration/video/v1/room_spec.rb +39 -0
  146. metadata +52 -2
@@ -57,15 +57,13 @@ describe 'Document' do
57
57
 
58
58
  expect {
59
59
  @client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
60
- .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete(if_match: 'if_match')
60
+ .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
61
61
  }.to raise_exception(Twilio::REST::TwilioError)
62
62
 
63
- headers = {'If-Match' => 'if_match', }
64
63
  expect(
65
64
  @holodeck.has_request?(Holodeck::Request.new(
66
65
  method: 'delete',
67
66
  url: 'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
68
- headers: headers,
69
67
  ))).to eq(true)
70
68
  end
71
69
 
@@ -97,9 +97,14 @@ describe 'Build' do
97
97
  "dependencies": [
98
98
  {
99
99
  "name": "twilio",
100
- "version": "3.6.3"
100
+ "version": "3.29.2"
101
+ },
102
+ {
103
+ "name": "@twilio/runtime-handler",
104
+ "version": "1.0.1"
101
105
  }
102
106
  ],
107
+ "runtime": "node10",
103
108
  "status": "deploying",
104
109
  "date_created": "2018-11-10T20:00:00Z",
105
110
  "date_updated": "2018-11-10T20:00:00Z",
@@ -192,9 +197,14 @@ describe 'Build' do
192
197
  "dependencies": [
193
198
  {
194
199
  "name": "twilio",
195
- "version": "3.6.3"
200
+ "version": "3.29.2"
201
+ },
202
+ {
203
+ "name": "@twilio/runtime-handler",
204
+ "version": "1.0.1"
196
205
  }
197
206
  ],
207
+ "runtime": "node10",
198
208
  "status": "building",
199
209
  "date_created": "2018-11-10T20:00:00Z",
200
210
  "date_updated": "2018-11-10T20:00:00Z",
@@ -40,6 +40,11 @@ describe 'Fleet' do
40
40
  "commands_enabled": true,
41
41
  "commands_method": "GET",
42
42
  "commands_url": "https://google.com",
43
+ "sms_commands_enabled": true,
44
+ "sms_commands_method": "GET",
45
+ "sms_commands_url": "https://google.com",
46
+ "ip_commands_method": "GET",
47
+ "ip_commands_url": "https://google.com",
43
48
  "network_access_profile_sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
44
49
  "sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
45
50
  "url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -81,6 +86,11 @@ describe 'Fleet' do
81
86
  "commands_enabled": true,
82
87
  "commands_method": "POST",
83
88
  "commands_url": null,
89
+ "sms_commands_enabled": true,
90
+ "sms_commands_method": "POST",
91
+ "sms_commands_url": null,
92
+ "ip_commands_method": "POST",
93
+ "ip_commands_url": null,
84
94
  "network_access_profile_sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
85
95
  "sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
86
96
  "url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -157,6 +167,11 @@ describe 'Fleet' do
157
167
  "commands_enabled": true,
158
168
  "commands_method": "POST",
159
169
  "commands_url": null,
170
+ "sms_commands_enabled": true,
171
+ "sms_commands_method": "POST",
172
+ "sms_commands_url": null,
173
+ "ip_commands_method": "POST",
174
+ "ip_commands_url": null,
160
175
  "network_access_profile_sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
161
176
  "sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
162
177
  "url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -200,6 +215,11 @@ describe 'Fleet' do
200
215
  "commands_enabled": true,
201
216
  "commands_method": "POST",
202
217
  "commands_url": null,
218
+ "sms_commands_enabled": true,
219
+ "sms_commands_method": "POST",
220
+ "sms_commands_url": null,
221
+ "ip_commands_method": "POST",
222
+ "ip_commands_url": null,
203
223
  "network_access_profile_sid": "HAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
204
224
  "sid": "HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
205
225
  "url": "https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -0,0 +1,184 @@
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 'SmsCommand' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.supersim.v1.sms_commands.create(sim: 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', payload: 'payload')
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {'Sim' => 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'Payload' => 'payload', }
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'post',
23
+ url: 'https://supersim.twilio.com/v1/SmsCommands',
24
+ data: values,
25
+ ))).to eq(true)
26
+ end
27
+
28
+ it "receives create_command_minimal responses" do
29
+ @holodeck.mock(Twilio::Response.new(
30
+ 201,
31
+ %q[
32
+ {
33
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "payload": "checkin: firmware update",
35
+ "date_created": "2015-07-30T20:00:00Z",
36
+ "date_updated": "2015-07-30T20:00:00Z",
37
+ "sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
+ "sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39
+ "status": "queued",
40
+ "direction": "to_sim",
41
+ "url": "https://supersim.twilio.com/v1/SmsCommands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
42
+ }
43
+ ]
44
+ ))
45
+
46
+ actual = @client.supersim.v1.sms_commands.create(sim: 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', payload: 'payload')
47
+
48
+ expect(actual).to_not eq(nil)
49
+ end
50
+
51
+ it "receives create_command_full responses" do
52
+ @holodeck.mock(Twilio::Response.new(
53
+ 201,
54
+ %q[
55
+ {
56
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
57
+ "payload": "Report location: (52.520008, 13.404954)",
58
+ "date_created": "2015-07-30T20:00:00Z",
59
+ "date_updated": "2015-07-30T20:00:00Z",
60
+ "sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
61
+ "sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
62
+ "status": "queued",
63
+ "direction": "to_sim",
64
+ "url": "https://supersim.twilio.com/v1/SmsCommands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
65
+ }
66
+ ]
67
+ ))
68
+
69
+ actual = @client.supersim.v1.sms_commands.create(sim: 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', payload: 'payload')
70
+
71
+ expect(actual).to_not eq(nil)
72
+ end
73
+
74
+ it "can fetch" do
75
+ @holodeck.mock(Twilio::Response.new(500, ''))
76
+
77
+ expect {
78
+ @client.supersim.v1.sms_commands('HCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
79
+ }.to raise_exception(Twilio::REST::TwilioError)
80
+
81
+ expect(
82
+ @holodeck.has_request?(Holodeck::Request.new(
83
+ method: 'get',
84
+ url: 'https://supersim.twilio.com/v1/SmsCommands/HCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
85
+ ))).to eq(true)
86
+ end
87
+
88
+ it "receives fetch responses" do
89
+ @holodeck.mock(Twilio::Response.new(
90
+ 200,
91
+ %q[
92
+ {
93
+ "sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
94
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
95
+ "payload": "content of the command",
96
+ "sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
97
+ "status": "queued",
98
+ "direction": "to_sim",
99
+ "date_created": "2015-07-30T20:00:00Z",
100
+ "date_updated": "2015-07-30T20:00:00Z",
101
+ "url": "https://supersim.twilio.com/v1/SmsCommands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
102
+ }
103
+ ]
104
+ ))
105
+
106
+ actual = @client.supersim.v1.sms_commands('HCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
107
+
108
+ expect(actual).to_not eq(nil)
109
+ end
110
+
111
+ it "can read" do
112
+ @holodeck.mock(Twilio::Response.new(500, ''))
113
+
114
+ expect {
115
+ @client.supersim.v1.sms_commands.list()
116
+ }.to raise_exception(Twilio::REST::TwilioError)
117
+
118
+ expect(
119
+ @holodeck.has_request?(Holodeck::Request.new(
120
+ method: 'get',
121
+ url: 'https://supersim.twilio.com/v1/SmsCommands',
122
+ ))).to eq(true)
123
+ end
124
+
125
+ it "receives read_empty responses" do
126
+ @holodeck.mock(Twilio::Response.new(
127
+ 200,
128
+ %q[
129
+ {
130
+ "sms_commands": [],
131
+ "meta": {
132
+ "first_page_url": "https://supersim.twilio.com/v1/SmsCommands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
133
+ "key": "sms_commands",
134
+ "next_page_url": null,
135
+ "page": 0,
136
+ "page_size": 50,
137
+ "previous_page_url": null,
138
+ "url": "https://supersim.twilio.com/v1/SmsCommands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0"
139
+ }
140
+ }
141
+ ]
142
+ ))
143
+
144
+ actual = @client.supersim.v1.sms_commands.list()
145
+
146
+ expect(actual).to_not eq(nil)
147
+ end
148
+
149
+ it "receives read_full responses" do
150
+ @holodeck.mock(Twilio::Response.new(
151
+ 200,
152
+ %q[
153
+ {
154
+ "meta": {
155
+ "first_page_url": "https://supersim.twilio.com/v1/SmsCommands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
156
+ "key": "sms_commands",
157
+ "next_page_url": null,
158
+ "page": 0,
159
+ "page_size": 50,
160
+ "previous_page_url": null,
161
+ "url": "https://supersim.twilio.com/v1/SmsCommands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0"
162
+ },
163
+ "sms_commands": [
164
+ {
165
+ "sid": "HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
166
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
167
+ "payload": "content of the command",
168
+ "sim_sid": "HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
169
+ "status": "queued",
170
+ "direction": "from_sim",
171
+ "date_created": "2015-07-30T20:00:00Z",
172
+ "date_updated": "2015-07-30T20:00:00Z",
173
+ "url": "https://supersim.twilio.com/v1/SmsCommands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
174
+ }
175
+ ]
176
+ }
177
+ ]
178
+ ))
179
+
180
+ actual = @client.supersim.v1.sms_commands.list()
181
+
182
+ expect(actual).to_not eq(nil)
183
+ end
184
+ end
@@ -58,15 +58,13 @@ describe 'Document' do
58
58
 
59
59
  expect {
60
60
  @client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
61
- .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete(if_match: 'if_match')
61
+ .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
62
62
  }.to raise_exception(Twilio::REST::TwilioError)
63
63
 
64
- headers = {'If-Match' => 'if_match', }
65
64
  expect(
66
65
  @holodeck.has_request?(Holodeck::Request.new(
67
66
  method: 'delete',
68
67
  url: 'https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
69
- headers: headers,
70
68
  ))).to eq(true)
71
69
  end
72
70
 
@@ -70,13 +70,15 @@ describe 'Task' do
70
70
 
71
71
  expect {
72
72
  @client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
73
- .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
73
+ .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(if_match: 'if_match')
74
74
  }.to raise_exception(Twilio::REST::TwilioError)
75
75
 
76
+ headers = {'If-Match' => 'if_match', }
76
77
  expect(
77
78
  @holodeck.has_request?(Holodeck::Request.new(
78
79
  method: 'post',
79
80
  url: 'https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Tasks/WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
81
+ headers: headers,
80
82
  ))).to eq(true)
81
83
  end
82
84
 
@@ -0,0 +1,192 @@
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 'CustomerProfilesChannelEndpointAssignment' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
+ .customer_profiles_channel_endpoint_assignment.create(channel_endpoint_type: 'channel_endpoint_type', channel_endpoint_sid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
18
+ }.to raise_exception(Twilio::REST::TwilioError)
19
+
20
+ values = {
21
+ 'ChannelEndpointType' => 'channel_endpoint_type',
22
+ 'ChannelEndpointSid' => 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
23
+ }
24
+ expect(
25
+ @holodeck.has_request?(Holodeck::Request.new(
26
+ method: 'post',
27
+ url: 'https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments',
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": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
+ "customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40
+ "channel_endpoint_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41
+ "channel_endpoint_type": "phone-number",
42
+ "date_created": "2019-07-31T02:34:41Z",
43
+ "url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
44
+ }
45
+ ]
46
+ ))
47
+
48
+ actual = @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
49
+ .customer_profiles_channel_endpoint_assignment.create(channel_endpoint_type: 'channel_endpoint_type', channel_endpoint_sid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
50
+
51
+ expect(actual).to_not eq(nil)
52
+ end
53
+
54
+ it "can read" do
55
+ @holodeck.mock(Twilio::Response.new(500, ''))
56
+
57
+ expect {
58
+ @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
59
+ .customer_profiles_channel_endpoint_assignment.list()
60
+ }.to raise_exception(Twilio::REST::TwilioError)
61
+
62
+ expect(
63
+ @holodeck.has_request?(Holodeck::Request.new(
64
+ method: 'get',
65
+ url: 'https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments',
66
+ ))).to eq(true)
67
+ end
68
+
69
+ it "receives read_empty responses" do
70
+ @holodeck.mock(Twilio::Response.new(
71
+ 200,
72
+ %q[
73
+ {
74
+ "results": [],
75
+ "meta": {
76
+ "page": 0,
77
+ "page_size": 50,
78
+ "first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?PageSize=50&Page=0",
79
+ "previous_page_url": null,
80
+ "url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?PageSize=50&Page=0",
81
+ "next_page_url": null,
82
+ "key": "results"
83
+ }
84
+ }
85
+ ]
86
+ ))
87
+
88
+ actual = @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
89
+ .customer_profiles_channel_endpoint_assignment.list()
90
+
91
+ expect(actual).to_not eq(nil)
92
+ end
93
+
94
+ it "receives read_full responses" do
95
+ @holodeck.mock(Twilio::Response.new(
96
+ 200,
97
+ %q[
98
+ {
99
+ "results": [
100
+ {
101
+ "sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
102
+ "customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
103
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
104
+ "channel_endpoint_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105
+ "channel_endpoint_type": "phone-number",
106
+ "date_created": "2019-07-31T02:34:41Z",
107
+ "url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
108
+ }
109
+ ],
110
+ "meta": {
111
+ "page": 0,
112
+ "page_size": 50,
113
+ "first_page_url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?ChannelEndpointSid=PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
114
+ "previous_page_url": null,
115
+ "url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments?ChannelEndpointSid=PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0",
116
+ "next_page_url": null,
117
+ "key": "results"
118
+ }
119
+ }
120
+ ]
121
+ ))
122
+
123
+ actual = @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
124
+ .customer_profiles_channel_endpoint_assignment.list()
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.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
134
+ .customer_profiles_channel_endpoint_assignment('RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
135
+ }.to raise_exception(Twilio::REST::TwilioError)
136
+
137
+ expect(
138
+ @holodeck.has_request?(Holodeck::Request.new(
139
+ method: 'get',
140
+ url: 'https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments/RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
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
+ "sid": "RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
150
+ "customer_profile_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
151
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
152
+ "channel_endpoint_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
153
+ "channel_endpoint_type": "phone-number",
154
+ "date_created": "2019-07-31T02:34:41Z",
155
+ "url": "https://trusthub.twilio.com/v1/CustomerProfiles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelEndpointAssignments/RAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
156
+ }
157
+ ]
158
+ ))
159
+
160
+ actual = @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
161
+ .customer_profiles_channel_endpoint_assignment('RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
162
+
163
+ expect(actual).to_not eq(nil)
164
+ end
165
+
166
+ it "can delete" do
167
+ @holodeck.mock(Twilio::Response.new(500, ''))
168
+
169
+ expect {
170
+ @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
171
+ .customer_profiles_channel_endpoint_assignment('RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
172
+ }.to raise_exception(Twilio::REST::TwilioError)
173
+
174
+ expect(
175
+ @holodeck.has_request?(Holodeck::Request.new(
176
+ method: 'delete',
177
+ url: 'https://trusthub.twilio.com/v1/CustomerProfiles/BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelEndpointAssignments/RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
178
+ ))).to eq(true)
179
+ end
180
+
181
+ it "receives delete responses" do
182
+ @holodeck.mock(Twilio::Response.new(
183
+ 204,
184
+ nil,
185
+ ))
186
+
187
+ actual = @client.trusthub.v1.customer_profiles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
188
+ .customer_profiles_channel_endpoint_assignment('RAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
189
+
190
+ expect(actual).to eq(true)
191
+ end
192
+ end