twilio-ruby 5.7.2 → 5.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -0
  3. data/CHANGES.md +19 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/framework/error.rb +20 -6
  6. data/lib/twilio-ruby/framework/version.rb +1 -10
  7. data/lib/twilio-ruby/jwt/access_token.rb +3 -1
  8. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +0 -7
  9. data/lib/twilio-ruby/rest/preview.rb +11 -3
  10. data/lib/twilio-ruby/rest/preview/understand.rb +6 -6
  11. data/lib/twilio-ruby/rest/preview/understand/{service.rb → assistant.rb} +94 -55
  12. data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/field_type.rb +33 -23
  13. data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/field_type/field_value.rb +30 -22
  14. data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/intent.rb +39 -25
  15. data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/intent/field.rb +20 -20
  16. data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/intent/sample.rb +45 -27
  17. data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/model_build.rb +21 -21
  18. data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/query.rb +31 -26
  19. data/lib/twilio-ruby/rest/studio/v1/flow/engagement.rb +6 -2
  20. data/lib/twilio-ruby/rest/video/v1/recording.rb +1 -1
  21. data/lib/twilio-ruby/version.rb +1 -1
  22. data/spec/integration/accounts/v1/credential/aws_spec.rb +9 -9
  23. data/spec/integration/accounts/v1/credential/public_key_spec.rb +9 -9
  24. data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +7 -7
  25. data/spec/integration/api/v2010/account/address_spec.rb +22 -22
  26. data/spec/integration/api/v2010/account/application_spec.rb +22 -22
  27. data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +9 -9
  28. data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +4 -4
  29. data/spec/integration/api/v2010/account/available_phone_number/machine_to_machine_spec.rb +4 -4
  30. data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +4 -4
  31. data/spec/integration/api/v2010/account/available_phone_number/national_spec.rb +4 -4
  32. data/spec/integration/api/v2010/account/available_phone_number/shared_cost_spec.rb +4 -4
  33. data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +4 -4
  34. data/spec/integration/api/v2010/account/available_phone_number/voip_spec.rb +4 -4
  35. data/spec/integration/api/v2010/account/available_phone_number_spec.rb +7 -7
  36. data/spec/integration/api/v2010/account/call/feedback_spec.rb +15 -15
  37. data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +13 -13
  38. data/spec/integration/api/v2010/account/call/notification_spec.rb +21 -21
  39. data/spec/integration/api/v2010/account/call/recording_spec.rb +21 -21
  40. data/spec/integration/api/v2010/account/call_spec.rb +22 -22
  41. data/spec/integration/api/v2010/account/conference/participant_spec.rb +35 -35
  42. data/spec/integration/api/v2010/account/conference_spec.rb +14 -14
  43. data/spec/integration/api/v2010/account/connect_app_spec.rb +14 -14
  44. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +19 -19
  45. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +29 -29
  46. data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +7 -7
  47. data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +7 -7
  48. data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +7 -7
  49. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +22 -22
  50. data/spec/integration/api/v2010/account/key_spec.rb +19 -19
  51. data/spec/integration/api/v2010/account/message/feedback_spec.rb +5 -5
  52. data/spec/integration/api/v2010/account/message/media_spec.rb +21 -21
  53. data/spec/integration/api/v2010/account/message_spec.rb +22 -22
  54. data/spec/integration/api/v2010/account/new_key_spec.rb +3 -3
  55. data/spec/integration/api/v2010/account/new_signing_key_spec.rb +3 -3
  56. data/spec/integration/api/v2010/account/notification_spec.rb +14 -14
  57. data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +19 -19
  58. data/spec/integration/api/v2010/account/queue/member_spec.rb +21 -21
  59. data/spec/integration/api/v2010/account/queue_spec.rb +22 -22
  60. data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +28 -28
  61. data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +21 -21
  62. data/spec/integration/api/v2010/account/recording/transcription_spec.rb +21 -21
  63. data/spec/integration/api/v2010/account/recording_spec.rb +14 -14
  64. data/spec/integration/api/v2010/account/short_code_spec.rb +14 -14
  65. data/spec/integration/api/v2010/account/signing_key_spec.rb +19 -19
  66. data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +33 -33
  67. data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +22 -22
  68. data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +29 -29
  69. data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +29 -29
  70. data/spec/integration/api/v2010/account/sip/domain_spec.rb +22 -22
  71. data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +33 -33
  72. data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +22 -22
  73. data/spec/integration/api/v2010/account/token_spec.rb +3 -3
  74. data/spec/integration/api/v2010/account/transcription_spec.rb +14 -14
  75. data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +4 -4
  76. data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +4 -4
  77. data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +4 -4
  78. data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +4 -4
  79. data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +4 -4
  80. data/spec/integration/api/v2010/account/usage/record/today_spec.rb +4 -4
  81. data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +4 -4
  82. data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +4 -4
  83. data/spec/integration/api/v2010/account/usage/record_spec.rb +4 -4
  84. data/spec/integration/api/v2010/account/usage/trigger_spec.rb +22 -22
  85. data/spec/integration/api/v2010/account/validation_request_spec.rb +3 -3
  86. data/spec/integration/api/v2010/account_spec.rb +84 -68
  87. data/spec/integration/chat/v1/credential_spec.rb +9 -9
  88. data/spec/integration/chat/v1/service/channel/invite_spec.rb +26 -26
  89. data/spec/integration/chat/v1/service/channel/member_spec.rb +36 -36
  90. data/spec/integration/chat/v1/service/channel/message_spec.rb +35 -35
  91. data/spec/integration/chat/v1/service/channel_spec.rb +22 -22
  92. data/spec/integration/chat/v1/service/role_spec.rb +22 -22
  93. data/spec/integration/chat/v1/service/user/user_channel_spec.rb +7 -7
  94. data/spec/integration/chat/v1/service/user_spec.rb +22 -22
  95. data/spec/integration/chat/v1/service_spec.rb +9 -9
  96. data/spec/integration/chat/v2/credential_spec.rb +9 -9
  97. data/spec/integration/chat/v2/service/binding_spec.rb +14 -14
  98. data/spec/integration/chat/v2/service/channel/invite_spec.rb +26 -26
  99. data/spec/integration/chat/v2/service/channel/member_spec.rb +33 -33
  100. data/spec/integration/chat/v2/service/channel/message_spec.rb +40 -40
  101. data/spec/integration/chat/v2/service/channel_spec.rb +22 -22
  102. data/spec/integration/chat/v2/service/role_spec.rb +22 -22
  103. data/spec/integration/chat/v2/service/user/user_binding_spec.rb +21 -21
  104. data/spec/integration/chat/v2/service/user/user_channel_spec.rb +7 -7
  105. data/spec/integration/chat/v2/service/user_spec.rb +22 -22
  106. data/spec/integration/chat/v2/service_spec.rb +9 -9
  107. data/spec/integration/fax/v1/fax/fax_media_spec.rb +13 -13
  108. data/spec/integration/fax/v1/fax_spec.rb +9 -9
  109. data/spec/integration/ip_messaging/v1/credential_spec.rb +9 -9
  110. data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +26 -26
  111. data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +36 -36
  112. data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +35 -35
  113. data/spec/integration/ip_messaging/v1/service/channel_spec.rb +22 -22
  114. data/spec/integration/ip_messaging/v1/service/role_spec.rb +22 -22
  115. data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +7 -7
  116. data/spec/integration/ip_messaging/v1/service/user_spec.rb +22 -22
  117. data/spec/integration/ip_messaging/v1/service_spec.rb +9 -9
  118. data/spec/integration/ip_messaging/v2/credential_spec.rb +9 -9
  119. data/spec/integration/ip_messaging/v2/service/binding_spec.rb +14 -14
  120. data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +26 -26
  121. data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +33 -33
  122. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +40 -40
  123. data/spec/integration/ip_messaging/v2/service/channel_spec.rb +22 -22
  124. data/spec/integration/ip_messaging/v2/service/role_spec.rb +22 -22
  125. data/spec/integration/ip_messaging/v2/service/user/user_binding_spec.rb +21 -21
  126. data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +7 -7
  127. data/spec/integration/ip_messaging/v2/service/user_spec.rb +22 -22
  128. data/spec/integration/ip_messaging/v2/service_spec.rb +9 -9
  129. data/spec/integration/lookups/v1/phone_number_spec.rb +0 -10
  130. data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +16 -16
  131. data/spec/integration/messaging/v1/service/phone_number_spec.rb +21 -21
  132. data/spec/integration/messaging/v1/service/short_code_spec.rb +19 -19
  133. data/spec/integration/messaging/v1/service_spec.rb +9 -9
  134. data/spec/integration/monitor/v1/alert_spec.rb +6 -6
  135. data/spec/integration/monitor/v1/event_spec.rb +3 -3
  136. data/spec/integration/notify/v1/credential_spec.rb +9 -9
  137. data/spec/integration/notify/v1/service/binding_spec.rb +17 -17
  138. data/spec/integration/notify/v1/service/notification_spec.rb +4 -4
  139. data/spec/integration/notify/v1/service/segment_spec.rb +4 -4
  140. data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +15 -15
  141. data/spec/integration/notify/v1/service/user/user_binding_spec.rb +28 -28
  142. data/spec/integration/notify/v1/service/user_spec.rb +17 -17
  143. data/spec/integration/notify/v1/service_spec.rb +9 -9
  144. data/spec/integration/preview/acc_security/service/verification_check_spec.rb +3 -3
  145. data/spec/integration/preview/acc_security/service/verification_spec.rb +3 -3
  146. data/spec/integration/preview/acc_security/service_spec.rb +6 -6
  147. data/spec/integration/preview/deployed_devices/fleet/certificate_spec.rb +22 -22
  148. data/spec/integration/preview/deployed_devices/fleet/deployment_spec.rb +22 -22
  149. data/spec/integration/preview/deployed_devices/fleet/device_spec.rb +22 -22
  150. data/spec/integration/preview/deployed_devices/fleet/key_spec.rb +22 -22
  151. data/spec/integration/preview/deployed_devices/fleet_spec.rb +9 -9
  152. data/spec/integration/preview/hosted_numbers/authorization_document/dependent_hosted_number_order_spec.rb +4 -4
  153. data/spec/integration/preview/hosted_numbers/authorization_document_spec.rb +9 -9
  154. data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +9 -9
  155. data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +9 -9
  156. data/spec/integration/preview/marketplace/available_add_on_spec.rb +3 -3
  157. data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +14 -14
  158. data/spec/integration/preview/marketplace/installed_add_on_spec.rb +12 -12
  159. data/spec/integration/preview/proxy/service/phone_number_spec.rb +19 -19
  160. data/spec/integration/preview/proxy/service/session/interaction_spec.rb +12 -12
  161. data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +23 -23
  162. data/spec/integration/preview/proxy/service/session/participant_spec.rb +31 -31
  163. data/spec/integration/preview/proxy/service/session_spec.rb +21 -21
  164. data/spec/integration/preview/proxy/service/short_code_spec.rb +19 -19
  165. data/spec/integration/preview/proxy/service_spec.rb +9 -9
  166. data/spec/integration/preview/studio/flow/engagement/step_spec.rb +12 -12
  167. data/spec/integration/preview/studio/flow/engagement_spec.rb +11 -11
  168. data/spec/integration/preview/studio/flow_spec.rb +6 -6
  169. data/spec/integration/preview/sync/service/document/document_permission_spec.rb +22 -22
  170. data/spec/integration/preview/sync/service/document_spec.rb +23 -23
  171. data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +33 -33
  172. data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +22 -22
  173. data/spec/integration/preview/sync/service/sync_list_spec.rb +17 -17
  174. data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +33 -33
  175. data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +22 -22
  176. data/spec/integration/preview/sync/service/sync_map_spec.rb +17 -17
  177. data/spec/integration/preview/sync/service_spec.rb +9 -9
  178. data/spec/integration/preview/understand/assistant/field_type/field_value_spec.rb +208 -0
  179. data/spec/integration/preview/understand/{service → assistant}/field_type_spec.rb +38 -38
  180. data/spec/integration/preview/understand/{service → assistant}/intent/field_spec.rb +36 -36
  181. data/spec/integration/preview/understand/assistant/intent/sample_spec.rb +251 -0
  182. data/spec/integration/preview/understand/{service → assistant}/intent_spec.rb +42 -46
  183. data/spec/integration/preview/understand/{service → assistant}/model_build_spec.rb +34 -34
  184. data/spec/integration/preview/understand/{service → assistant}/query_spec.rb +42 -38
  185. data/spec/integration/preview/understand/{service_spec.rb → assistant_spec.rb} +57 -49
  186. data/spec/integration/preview/wireless/command_spec.rb +3 -3
  187. data/spec/integration/preview/wireless/rate_plan_spec.rb +9 -9
  188. data/spec/integration/preview/wireless/sim/usage_spec.rb +3 -3
  189. data/spec/integration/preview/wireless/sim_spec.rb +6 -6
  190. data/spec/integration/proxy/v1/service/phone_number_spec.rb +16 -16
  191. data/spec/integration/proxy/v1/service/session/interaction_spec.rb +19 -19
  192. data/spec/integration/proxy/v1/service/session/participant/message_interaction_spec.rb +23 -23
  193. data/spec/integration/proxy/v1/service/session/participant_spec.rb +31 -31
  194. data/spec/integration/proxy/v1/service/session_spec.rb +21 -21
  195. data/spec/integration/proxy/v1/service/short_code_spec.rb +19 -19
  196. data/spec/integration/proxy/v1/service_spec.rb +9 -9
  197. data/spec/integration/studio/v1/flow/engagement/engagement_context_spec.rb +5 -5
  198. data/spec/integration/studio/v1/flow/engagement/step/step_context_spec.rb +7 -7
  199. data/spec/integration/studio/v1/flow/engagement/step_spec.rb +12 -12
  200. data/spec/integration/studio/v1/flow/engagement_spec.rb +11 -11
  201. data/spec/integration/studio/v1/flow_spec.rb +6 -6
  202. data/spec/integration/sync/v1/service/document/document_permission_spec.rb +22 -22
  203. data/spec/integration/sync/v1/service/document_spec.rb +22 -22
  204. data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +30 -30
  205. data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +22 -22
  206. data/spec/integration/sync/v1/service/sync_list_spec.rb +22 -22
  207. data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +30 -30
  208. data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +22 -22
  209. data/spec/integration/sync/v1/service/sync_map_spec.rb +22 -22
  210. data/spec/integration/sync/v1/service/sync_stream/stream_message_spec.rb +8 -8
  211. data/spec/integration/sync/v1/service/sync_stream_spec.rb +22 -22
  212. data/spec/integration/sync/v1/service_spec.rb +9 -9
  213. data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +22 -22
  214. data/spec/integration/taskrouter/v1/workspace/event_spec.rb +9 -9
  215. data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +21 -21
  216. data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +9 -9
  217. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics_spec.rb +5 -5
  218. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics_spec.rb +5 -5
  219. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +5 -5
  220. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +4 -4
  221. data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +26 -26
  222. data/spec/integration/taskrouter/v1/workspace/task_spec.rb +23 -23
  223. data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +21 -21
  224. data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +21 -21
  225. data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +5 -5
  226. data/spec/integration/taskrouter/v1/workspace/worker/workers_cumulative_statistics_spec.rb +5 -5
  227. data/spec/integration/taskrouter/v1/workspace/worker/workers_real_time_statistics_spec.rb +5 -5
  228. data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +3 -3
  229. data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +22 -22
  230. data/spec/integration/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics_spec.rb +5 -5
  231. data/spec/integration/taskrouter/v1/workspace/workflow/workflow_real_time_statistics_spec.rb +5 -5
  232. data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +5 -5
  233. data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +22 -22
  234. data/spec/integration/taskrouter/v1/workspace/workspace_cumulative_statistics_spec.rb +3 -3
  235. data/spec/integration/taskrouter/v1/workspace/workspace_real_time_statistics_spec.rb +3 -3
  236. data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +3 -3
  237. data/spec/integration/taskrouter/v1/workspace_spec.rb +9 -9
  238. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +20 -20
  239. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +20 -20
  240. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +22 -22
  241. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +20 -20
  242. data/spec/integration/trunking/v1/trunk_spec.rb +9 -9
  243. data/spec/integration/video/v1/composition_spec.rb +6 -6
  244. data/spec/integration/video/v1/recording_spec.rb +10 -6
  245. data/spec/integration/video/v1/room/recording_spec.rb +9 -9
  246. data/spec/integration/video/v1/room/room_participant/room_participant_published_track_spec.rb +12 -12
  247. data/spec/integration/video/v1/room/room_participant/room_participant_subscribed_track_spec.rb +12 -12
  248. data/spec/integration/video/v1/room/room_participant_spec.rb +14 -14
  249. data/spec/integration/video/v1/room_spec.rb +6 -6
  250. data/spec/integration/wireless/v1/command_spec.rb +3 -3
  251. data/spec/integration/wireless/v1/rate_plan_spec.rb +9 -9
  252. data/spec/integration/wireless/v1/sim/data_session_spec.rb +3 -3
  253. data/spec/integration/wireless/v1/sim/usage_record_spec.rb +3 -3
  254. data/spec/integration/wireless/v1/sim_spec.rb +6 -6
  255. data/spec/jwt/access_token_spec.rb +2 -0
  256. metadata +26 -26
  257. data/spec/integration/preview/understand/service/field_type/field_value_spec.rb +0 -205
  258. data/spec/integration/preview/understand/service/intent/sample_spec.rb +0 -247
@@ -1,205 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # \ / _ _ _| _ _
4
- # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
- # / /
6
-
7
- require 'spec_helper.rb'
8
-
9
- describe 'FieldValue' do
10
- it "can fetch" do
11
- @holodeck.mock(Twilio::Response.new(500, ''))
12
-
13
- expect {
14
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
15
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
16
- .field_values('UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch()
17
- }.to raise_exception(Twilio::REST::TwilioError)
18
-
19
- values = {}
20
- expect(
21
- @holodeck.has_request?(Holodeck::Request.new(
22
- method: 'get',
23
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
24
- ))).to eq(true)
25
- end
26
-
27
- it "receives fetch responses" do
28
- @holodeck.mock(Twilio::Response.new(
29
- 200,
30
- %q[
31
- {
32
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
- "field_type_sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
- "language": "language",
36
- "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37
- "value": "value",
38
- "date_updated": "2015-07-30T20:00:00Z",
39
- "date_created": "2015-07-30T20:00:00Z",
40
- "sid": "UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
41
- }
42
- ]
43
- ))
44
-
45
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
46
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
47
- .field_values('UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch()
48
-
49
- expect(actual).to_not eq(nil)
50
- end
51
-
52
- it "can read" do
53
- @holodeck.mock(Twilio::Response.new(500, ''))
54
-
55
- expect {
56
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
57
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
58
- .field_values.list()
59
- }.to raise_exception(Twilio::REST::TwilioError)
60
-
61
- values = {}
62
- expect(
63
- @holodeck.has_request?(Holodeck::Request.new(
64
- method: 'get',
65
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues',
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
- "field_values": [],
75
- "meta": {
76
- "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?PageSize=50&Page=0",
77
- "page_size": 50,
78
- "previous_page_url": null,
79
- "key": "field_values",
80
- "page": 0,
81
- "next_page_url": null,
82
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?PageSize=50&Page=0"
83
- }
84
- }
85
- ]
86
- ))
87
-
88
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
89
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
90
- .field_values.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
- "field_values": [
101
- {
102
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
103
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
104
- "field_type_sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105
- "language": "language",
106
- "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
107
- "value": "value",
108
- "date_updated": "2015-07-30T20:00:00Z",
109
- "date_created": "2015-07-30T20:00:00Z",
110
- "sid": "UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
111
- }
112
- ],
113
- "meta": {
114
- "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?PageSize=50&Page=0",
115
- "page_size": 50,
116
- "previous_page_url": null,
117
- "key": "field_values",
118
- "page": 0,
119
- "next_page_url": null,
120
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?PageSize=50&Page=0"
121
- }
122
- }
123
- ]
124
- ))
125
-
126
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
127
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
128
- .field_values.list()
129
-
130
- expect(actual).to_not eq(nil)
131
- end
132
-
133
- it "can create" do
134
- @holodeck.mock(Twilio::Response.new(500, ''))
135
-
136
- expect {
137
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
138
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
139
- .field_values.create(language: 'language', value: 'value')
140
- }.to raise_exception(Twilio::REST::TwilioError)
141
-
142
- values = {'Language' => 'language', 'Value' => 'value', }
143
- expect(
144
- @holodeck.has_request?(Holodeck::Request.new(
145
- method: 'post',
146
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues',
147
- data: values,
148
- ))).to eq(true)
149
- end
150
-
151
- it "receives create responses" do
152
- @holodeck.mock(Twilio::Response.new(
153
- 201,
154
- %q[
155
- {
156
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
157
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
158
- "field_type_sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
159
- "language": "language",
160
- "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
161
- "value": "value",
162
- "date_updated": "2015-07-30T20:00:00Z",
163
- "date_created": "2015-07-30T20:00:00Z",
164
- "sid": "UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
165
- }
166
- ]
167
- ))
168
-
169
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
170
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
171
- .field_values.create(language: 'language', value: 'value')
172
-
173
- expect(actual).to_not eq(nil)
174
- end
175
-
176
- it "can delete" do
177
- @holodeck.mock(Twilio::Response.new(500, ''))
178
-
179
- expect {
180
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
181
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
182
- .field_values('UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').delete()
183
- }.to raise_exception(Twilio::REST::TwilioError)
184
-
185
- values = {}
186
- expect(
187
- @holodeck.has_request?(Holodeck::Request.new(
188
- method: 'delete',
189
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
190
- ))).to eq(true)
191
- end
192
-
193
- it "receives delete responses" do
194
- @holodeck.mock(Twilio::Response.new(
195
- 204,
196
- nil,
197
- ))
198
-
199
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
200
- .field_types('UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
201
- .field_values('UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').delete()
202
-
203
- expect(actual).to eq(true)
204
- end
205
- end
@@ -1,247 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # \ / _ _ _| _ _
4
- # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
- # / /
6
-
7
- require 'spec_helper.rb'
8
-
9
- describe 'Sample' do
10
- it "can fetch" do
11
- @holodeck.mock(Twilio::Response.new(500, ''))
12
-
13
- expect {
14
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
15
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
16
- .samples('UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch()
17
- }.to raise_exception(Twilio::REST::TwilioError)
18
-
19
- values = {}
20
- expect(
21
- @holodeck.has_request?(Holodeck::Request.new(
22
- method: 'get',
23
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
24
- ))).to eq(true)
25
- end
26
-
27
- it "receives fetch responses" do
28
- @holodeck.mock(Twilio::Response.new(
29
- 200,
30
- %q[
31
- {
32
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
- "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
- "sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
- "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37
- "date_created": "2015-07-30T20:00:00Z",
38
- "language": "language",
39
- "tagged_text": "tagged_text",
40
- "date_updated": "2015-07-30T20:00:00Z"
41
- }
42
- ]
43
- ))
44
-
45
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
46
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
47
- .samples('UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch()
48
-
49
- expect(actual).to_not eq(nil)
50
- end
51
-
52
- it "can read" do
53
- @holodeck.mock(Twilio::Response.new(500, ''))
54
-
55
- expect {
56
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
57
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
58
- .samples.list()
59
- }.to raise_exception(Twilio::REST::TwilioError)
60
-
61
- values = {}
62
- expect(
63
- @holodeck.has_request?(Holodeck::Request.new(
64
- method: 'get',
65
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples',
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
- "samples": [],
75
- "meta": {
76
- "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0",
77
- "previous_page_url": null,
78
- "key": "samples",
79
- "next_page_url": null,
80
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0",
81
- "page": 0,
82
- "page_size": 50
83
- }
84
- }
85
- ]
86
- ))
87
-
88
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
89
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
90
- .samples.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
- "samples": [
101
- {
102
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
103
- "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
104
- "sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105
- "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
106
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
107
- "date_created": "2015-07-30T20:00:00Z",
108
- "language": "language",
109
- "tagged_text": "tagged_text",
110
- "date_updated": "2015-07-30T20:00:00Z"
111
- }
112
- ],
113
- "meta": {
114
- "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0",
115
- "previous_page_url": null,
116
- "key": "samples",
117
- "next_page_url": null,
118
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0",
119
- "page": 0,
120
- "page_size": 50
121
- }
122
- }
123
- ]
124
- ))
125
-
126
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
127
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
128
- .samples.list()
129
-
130
- expect(actual).to_not eq(nil)
131
- end
132
-
133
- it "can create" do
134
- @holodeck.mock(Twilio::Response.new(500, ''))
135
-
136
- expect {
137
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
138
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
139
- .samples.create(language: 'language', tagged_text: 'tagged_text')
140
- }.to raise_exception(Twilio::REST::TwilioError)
141
-
142
- values = {'Language' => 'language', 'TaggedText' => 'tagged_text', }
143
- expect(
144
- @holodeck.has_request?(Holodeck::Request.new(
145
- method: 'post',
146
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples',
147
- data: values,
148
- ))).to eq(true)
149
- end
150
-
151
- it "receives create responses" do
152
- @holodeck.mock(Twilio::Response.new(
153
- 201,
154
- %q[
155
- {
156
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
157
- "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
158
- "sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
159
- "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
160
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
161
- "date_created": "2015-07-30T20:00:00Z",
162
- "language": "language",
163
- "tagged_text": "tagged_text",
164
- "date_updated": "2015-07-30T20:00:00Z"
165
- }
166
- ]
167
- ))
168
-
169
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
170
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
171
- .samples.create(language: 'language', tagged_text: 'tagged_text')
172
-
173
- expect(actual).to_not eq(nil)
174
- end
175
-
176
- it "can update" do
177
- @holodeck.mock(Twilio::Response.new(500, ''))
178
-
179
- expect {
180
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
181
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
182
- .samples('UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update()
183
- }.to raise_exception(Twilio::REST::TwilioError)
184
-
185
- values = {}
186
- expect(
187
- @holodeck.has_request?(Holodeck::Request.new(
188
- method: 'post',
189
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
190
- ))).to eq(true)
191
- end
192
-
193
- it "receives update responses" do
194
- @holodeck.mock(Twilio::Response.new(
195
- 200,
196
- %q[
197
- {
198
- "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
199
- "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
200
- "sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
201
- "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
202
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
203
- "date_created": "2015-07-30T20:00:00Z",
204
- "language": "language",
205
- "tagged_text": "tagged_text",
206
- "date_updated": "2015-07-30T20:00:00Z"
207
- }
208
- ]
209
- ))
210
-
211
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
212
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
213
- .samples('UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update()
214
-
215
- expect(actual).to_not eq(nil)
216
- end
217
-
218
- it "can delete" do
219
- @holodeck.mock(Twilio::Response.new(500, ''))
220
-
221
- expect {
222
- @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
223
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
224
- .samples('UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').delete()
225
- }.to raise_exception(Twilio::REST::TwilioError)
226
-
227
- values = {}
228
- expect(
229
- @holodeck.has_request?(Holodeck::Request.new(
230
- method: 'delete',
231
- url: 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
232
- ))).to eq(true)
233
- end
234
-
235
- it "receives delete responses" do
236
- @holodeck.mock(Twilio::Response.new(
237
- 204,
238
- nil,
239
- ))
240
-
241
- actual = @client.preview.understand.services('UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
242
- .intents('UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') \
243
- .samples('UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').delete()
244
-
245
- expect(actual).to eq(true)
246
- end
247
- end