twilio-ruby 5.0.0.rc19 → 5.0.0.rc20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +8 -0
  3. data/README.md +2 -2
  4. data/VERSIONS.md +64 -0
  5. data/lib/twilio-ruby/framework/{exception.rb → error.rb} +3 -2
  6. data/lib/twilio-ruby/framework/page.rb +3 -3
  7. data/lib/twilio-ruby/framework/serialize.rb +9 -0
  8. data/lib/twilio-ruby/framework/version.rb +1 -1
  9. data/lib/twilio-ruby/http/http_client.rb +1 -0
  10. data/lib/twilio-ruby/jwt/access_token.rb +28 -0
  11. data/lib/twilio-ruby/rest/client.rb +64 -42
  12. data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +303 -0
  13. data/lib/twilio-ruby/rest/fax/v1/fax.rb +80 -6
  14. data/lib/twilio-ruby/rest/messaging/v1/service.rb +50 -3
  15. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
  16. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +2 -2
  17. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +2 -2
  18. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +2 -2
  19. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +2 -2
  20. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +38 -17
  21. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +74 -2
  22. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +377 -0
  23. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +415 -0
  24. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +409 -0
  25. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +377 -0
  26. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +407 -0
  27. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +411 -0
  28. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +377 -0
  29. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +407 -0
  30. data/lib/twilio-ruby/rest/sync/v1/service.rb +469 -0
  31. data/lib/twilio-ruby/rest/sync/v1.rb +35 -0
  32. data/lib/twilio-ruby/rest/sync.rb +40 -0
  33. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +324 -0
  34. data/lib/twilio-ruby/rest/video/v1/room.rb +37 -0
  35. data/lib/twilio-ruby/rest/wireless/v1/command.rb +344 -0
  36. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +399 -0
  37. data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +222 -0
  38. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +502 -0
  39. data/lib/twilio-ruby/rest/wireless/v1.rb +53 -0
  40. data/lib/twilio-ruby/rest/wireless.rb +48 -0
  41. data/lib/twilio-ruby/security/request_validator.rb +19 -1
  42. data/lib/twilio-ruby/version.rb +1 -1
  43. data/spec/framework/serialize_spec.rb +20 -1
  44. data/spec/integration/accounts/v1/credential/public_key_spec.rb +5 -5
  45. data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +1 -1
  46. data/spec/integration/api/v2010/account/address_spec.rb +5 -5
  47. data/spec/integration/api/v2010/account/application_spec.rb +5 -5
  48. data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +2 -2
  49. data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +1 -1
  50. data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +1 -1
  51. data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +1 -1
  52. data/spec/integration/api/v2010/account/available_phone_number_spec.rb +2 -2
  53. data/spec/integration/api/v2010/account/call/feedback_spec.rb +3 -3
  54. data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +3 -3
  55. data/spec/integration/api/v2010/account/call/notification_spec.rb +3 -3
  56. data/spec/integration/api/v2010/account/call/recording_spec.rb +3 -3
  57. data/spec/integration/api/v2010/account/call_spec.rb +5 -5
  58. data/spec/integration/api/v2010/account/conference/participant_spec.rb +5 -5
  59. data/spec/integration/api/v2010/account/conference_spec.rb +3 -3
  60. data/spec/integration/api/v2010/account/connect_app_spec.rb +3 -3
  61. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +2 -2
  62. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +4 -4
  63. data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +2 -2
  64. data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +2 -2
  65. data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +2 -2
  66. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +5 -5
  67. data/spec/integration/api/v2010/account/key_spec.rb +4 -4
  68. data/spec/integration/api/v2010/account/message/feedback_spec.rb +1 -1
  69. data/spec/integration/api/v2010/account/message/media_spec.rb +3 -3
  70. data/spec/integration/api/v2010/account/message_spec.rb +5 -5
  71. data/spec/integration/api/v2010/account/new_key_spec.rb +1 -1
  72. data/spec/integration/api/v2010/account/new_signing_key_spec.rb +1 -1
  73. data/spec/integration/api/v2010/account/notification_spec.rb +3 -3
  74. data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +4 -4
  75. data/spec/integration/api/v2010/account/queue/member_spec.rb +3 -3
  76. data/spec/integration/api/v2010/account/queue_spec.rb +5 -5
  77. data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +3 -3
  78. data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +3 -3
  79. data/spec/integration/api/v2010/account/recording/transcription_spec.rb +3 -3
  80. data/spec/integration/api/v2010/account/recording_spec.rb +3 -3
  81. data/spec/integration/api/v2010/account/short_code_spec.rb +3 -3
  82. data/spec/integration/api/v2010/account/signing_key_spec.rb +4 -4
  83. data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +5 -5
  84. data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +5 -5
  85. data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +4 -4
  86. data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +4 -4
  87. data/spec/integration/api/v2010/account/sip/domain_spec.rb +5 -5
  88. data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +5 -5
  89. data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +5 -5
  90. data/spec/integration/api/v2010/account/token_spec.rb +1 -1
  91. data/spec/integration/api/v2010/account/transcription_spec.rb +3 -3
  92. data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +1 -1
  93. data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +1 -1
  94. data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +1 -1
  95. data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +1 -1
  96. data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +1 -1
  97. data/spec/integration/api/v2010/account/usage/record/today_spec.rb +1 -1
  98. data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +1 -1
  99. data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +1 -1
  100. data/spec/integration/api/v2010/account/usage/record_spec.rb +1 -1
  101. data/spec/integration/api/v2010/account/usage/trigger_spec.rb +5 -5
  102. data/spec/integration/api/v2010/account/validation_request_spec.rb +1 -1
  103. data/spec/integration/api/v2010/account_spec.rb +4 -4
  104. data/spec/integration/chat/v1/credential_spec.rb +5 -5
  105. data/spec/integration/chat/v1/service/channel/invite_spec.rb +4 -4
  106. data/spec/integration/chat/v1/service/channel/member_spec.rb +5 -5
  107. data/spec/integration/chat/v1/service/channel/message_spec.rb +5 -5
  108. data/spec/integration/chat/v1/service/channel_spec.rb +5 -5
  109. data/spec/integration/chat/v1/service/role_spec.rb +5 -5
  110. data/spec/integration/chat/v1/service/user/user_channel_spec.rb +1 -1
  111. data/spec/integration/chat/v1/service/user_spec.rb +5 -5
  112. data/spec/integration/chat/v1/service_spec.rb +5 -5
  113. data/spec/integration/chat/v2/credential_spec.rb +5 -5
  114. data/spec/integration/chat/v2/service/channel/invite_spec.rb +4 -4
  115. data/spec/integration/chat/v2/service/channel/member_spec.rb +5 -5
  116. data/spec/integration/chat/v2/service/channel/message_spec.rb +5 -5
  117. data/spec/integration/chat/v2/service/channel_spec.rb +5 -5
  118. data/spec/integration/chat/v2/service/role_spec.rb +5 -5
  119. data/spec/integration/chat/v2/service/user/user_channel_spec.rb +1 -1
  120. data/spec/integration/chat/v2/service/user_spec.rb +5 -5
  121. data/spec/integration/chat/v2/service_spec.rb +5 -5
  122. data/spec/integration/fax/v1/fax/fax_media_spec.rb +126 -0
  123. data/spec/integration/fax/v1/fax_spec.rb +48 -7
  124. data/spec/integration/ip_messaging/v1/credential_spec.rb +5 -5
  125. data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +4 -4
  126. data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +5 -5
  127. data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +5 -5
  128. data/spec/integration/ip_messaging/v1/service/channel_spec.rb +5 -5
  129. data/spec/integration/ip_messaging/v1/service/role_spec.rb +5 -5
  130. data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +1 -1
  131. data/spec/integration/ip_messaging/v1/service/user_spec.rb +5 -5
  132. data/spec/integration/ip_messaging/v1/service_spec.rb +5 -5
  133. data/spec/integration/ip_messaging/v2/credential_spec.rb +5 -5
  134. data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +4 -4
  135. data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +5 -5
  136. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +5 -5
  137. data/spec/integration/ip_messaging/v2/service/channel_spec.rb +5 -5
  138. data/spec/integration/ip_messaging/v2/service/role_spec.rb +5 -5
  139. data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +1 -1
  140. data/spec/integration/ip_messaging/v2/service/user_spec.rb +5 -5
  141. data/spec/integration/ip_messaging/v2/service_spec.rb +5 -5
  142. data/spec/integration/lookups/v1/phone_number_spec.rb +1 -1
  143. data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +4 -4
  144. data/spec/integration/messaging/v1/service/phone_number_spec.rb +4 -4
  145. data/spec/integration/messaging/v1/service/short_code_spec.rb +4 -4
  146. data/spec/integration/messaging/v1/service_spec.rb +21 -5
  147. data/spec/integration/monitor/v1/alert_spec.rb +3 -3
  148. data/spec/integration/monitor/v1/event_spec.rb +2 -2
  149. data/spec/integration/notify/v1/credential_spec.rb +5 -5
  150. data/spec/integration/notify/v1/service/binding_spec.rb +4 -4
  151. data/spec/integration/notify/v1/service/notification_spec.rb +1 -1
  152. data/spec/integration/notify/v1/service/segment_spec.rb +1 -1
  153. data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +3 -3
  154. data/spec/integration/notify/v1/service/user/user_binding_spec.rb +4 -4
  155. data/spec/integration/notify/v1/service/user_spec.rb +4 -4
  156. data/spec/integration/notify/v1/service_spec.rb +5 -5
  157. data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +2 -2
  158. data/spec/integration/preview/marketplace/available_add_on_spec.rb +2 -2
  159. data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +3 -3
  160. data/spec/integration/preview/marketplace/installed_add_on_spec.rb +5 -5
  161. data/spec/integration/preview/sync/service/document/document_permission_spec.rb +4 -4
  162. data/spec/integration/preview/sync/service/document_spec.rb +6 -6
  163. data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +7 -7
  164. data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +4 -4
  165. data/spec/integration/preview/sync/service/sync_list_spec.rb +4 -4
  166. data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +7 -7
  167. data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +4 -4
  168. data/spec/integration/preview/sync/service/sync_map_spec.rb +4 -4
  169. data/spec/integration/preview/sync/service_spec.rb +5 -5
  170. data/spec/integration/preview/wireless/command_spec.rb +3 -3
  171. data/spec/integration/preview/wireless/rate_plan_spec.rb +45 -45
  172. data/spec/integration/preview/wireless/sim/usage_spec.rb +1 -1
  173. data/spec/integration/preview/wireless/sim_spec.rb +27 -3
  174. data/spec/integration/pricing/v1/messaging/country_spec.rb +2 -2
  175. data/spec/integration/pricing/v1/phone_number/country_spec.rb +2 -2
  176. data/spec/integration/pricing/v1/voice/country_spec.rb +2 -2
  177. data/spec/integration/pricing/v1/voice/number_spec.rb +1 -1
  178. data/spec/integration/sync/v1/service/document/document_permission_spec.rb +206 -0
  179. data/spec/integration/sync/v1/service/document_spec.rb +254 -0
  180. data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +256 -0
  181. data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +206 -0
  182. data/spec/integration/sync/v1/service/sync_list_spec.rb +207 -0
  183. data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +257 -0
  184. data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +206 -0
  185. data/spec/integration/sync/v1/service/sync_map_spec.rb +207 -0
  186. data/spec/integration/sync/v1/service_spec.rb +244 -0
  187. data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +5 -5
  188. data/spec/integration/taskrouter/v1/workspace/event_spec.rb +2 -2
  189. data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +3 -3
  190. data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +2 -2
  191. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +1 -1
  192. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +1 -1
  193. data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +5 -5
  194. data/spec/integration/taskrouter/v1/workspace/task_spec.rb +5 -5
  195. data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +3 -3
  196. data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +3 -3
  197. data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +1 -1
  198. data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +1 -1
  199. data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +5 -5
  200. data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +1 -1
  201. data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +5 -5
  202. data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +1 -1
  203. data/spec/integration/taskrouter/v1/workspace_spec.rb +5 -5
  204. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +4 -4
  205. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +4 -4
  206. data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +5 -5
  207. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +4 -4
  208. data/spec/integration/trunking/v1/trunk_spec.rb +5 -5
  209. data/spec/integration/video/v1/recording_spec.rb +3 -3
  210. data/spec/integration/video/v1/room/recording_spec.rb +145 -0
  211. data/spec/integration/video/v1/room_spec.rb +20 -8
  212. data/spec/integration/wireless/v1/command_spec.rb +166 -0
  213. data/spec/integration/wireless/v1/rate_plan_spec.rb +260 -0
  214. data/spec/integration/wireless/v1/sim/usage_record_spec.rb +65 -0
  215. data/spec/integration/wireless/v1/sim_spec.rb +208 -0
  216. data/twilio-ruby.gemspec +1 -1
  217. metadata +55 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dba18a84d3ea275b33269aff666af1928443e47a
4
- data.tar.gz: 5e97a408b7bc62067632cfcc37a38c20fadb3a6b
3
+ metadata.gz: 5a237c668281992d46d1bdd3c6d9417a8f2ca040
4
+ data.tar.gz: 70bcf47381f5e55675fe35ac01bee5de15355f36
5
5
  SHA512:
6
- metadata.gz: bb1727016dd35b1ef9259b94a03e00debed4231c3d86e0625c2d081412881d7a586224d60d6f3b30affc807543f8aca058adbe6ac68aeb26687bf6a74d061c48
7
- data.tar.gz: d5bb365effca9041f73b11bd614447188491ecdfbb7c9c13e37c4b93defd9aa56c754cdfe63e1b7b4c7c6eaa8eb877f195c034f0965f765b2ccba91b0f19317f
6
+ metadata.gz: be90b36898a29bdb6744d61a45199a0f47bfe128010f7c61088ef4ecd90d77f1f35e06b54c3f4ded8da47ee86e1c520e021a8bfc87b727816ef2e7be91525568
7
+ data.tar.gz: 020e62824e298f3c106e9a4fcd38d97b1e8f6202a92623cd227a8586dc501a3ffcfaf414f187ede70044340034e4ad41afd6001e13d0577421aa475d6eb84f71
data/CHANGES.md CHANGED
@@ -1,6 +1,14 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2017-05-22] Version 5.0.0-rc20
5
+ - Add Wireless Domain
6
+ - Add Fax Domain
7
+ - Add Video Domain
8
+ - Updated Usage Trigger enums with missing categories.
9
+ - Add `area_code_geomatch`, `validtiy_period`, `fallback_to_long_code` to Messaging Service
10
+ - Converted `TwilioException` to `TwilioError`
11
+
4
12
  [2017-04-27] Version 5.0.0-rc19
5
13
  ------------------
6
14
 
data/README.md CHANGED
@@ -11,13 +11,13 @@ A module for using the Twilio REST API and generating valid [TwiML](http://www.t
11
11
  To install using [Bundler][bundler] grab the latest stable version:
12
12
 
13
13
  ```ruby
14
- gem 'twilio-ruby', '~> 5.0.0.rc17'
14
+ gem 'twilio-ruby', '~> 5.0.0.rc20'
15
15
  ```
16
16
 
17
17
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
18
18
 
19
19
  ```bash
20
- gem install twilio-ruby -v 5.0.0.rc17
20
+ gem install twilio-ruby -v 5.0.0.rc20
21
21
  ```
22
22
 
23
23
  To build and install the development branch yourself from the latest source:
data/VERSIONS.md ADDED
@@ -0,0 +1,64 @@
1
+ # Versioning Strategy
2
+
3
+ `twilio-ruby` uses a modified version of [Semantic Versioning][semver] for all
4
+ changes to the helper library. It is strongly encouraged that you pin at least
5
+ the major version and potentially the minor version to avoid pulling in breaking
6
+ changes.
7
+
8
+ Semantic Versions take the form of `MAJOR`.`MINOR`.`PATCH`
9
+
10
+ When bugs are fixed in the library in a backwards compatible way, the `PATCH`
11
+ level will be incremented by one. When new features are added to the library
12
+ in a backwards compatible way, the `PATCH` level will be incremented by one.
13
+ `PATCH` changes should _not_ break your code and are generally safe for upgrade.
14
+
15
+ When a new large feature set comes online or a small breaking change is
16
+ introduced, the `MINOR` version will be incremented by one and the `PATCH`
17
+ version reset to zero. `MINOR` changes _may_ require some amount of manual code
18
+ change for upgrade. These backwards-incompatible changes will generally be limited
19
+ to a small number of function signature changes.
20
+
21
+ The `MAJOR` version is used to indicate the family of technology represented by
22
+ the helper library. It increased from `4.x.x` to `5.x.x` when Twilio moved to
23
+ auto generation of helper libraries. Breaking changes that requires extensive
24
+ reworking of code (like the `4.x.x` to `5.x.x` upgrade) will case the `MAJOR`
25
+ version to be incremented by one, the `MINOR` and `PATCH` versions will be reset
26
+ to zero. Twilio understands that this can be very disruptive, we will only
27
+ introduce this type of breaking change when absolutely necessary. New `MAJOR`
28
+ versions will be communicated in advance with `Release Candidates` and a
29
+ schedule.
30
+
31
+ ## Supported Versions
32
+
33
+ `twilio-ruby` follows an evergreen model of support. New features and
34
+ functionality will only be added to the current version. The current version -
35
+ 1 will continue to be supported with bugfixes and security updates, but no new
36
+ features.
37
+
38
+ ## Edge Features (alpha Branch)
39
+
40
+ Twilio frequently rolls out new features in public and private beta periods.
41
+ Twilio strives to ship early and often and bake customer feedback back into our
42
+ products. To support that mission, the `twilio-ruby` helper library has an
43
+ `Edge` version based of the `alpha` branch. This version is identified with an
44
+ `alpha` metadata tag on the version number.
45
+
46
+ The way the `Edge` artifact is created is by playing the `Edge` features on top
47
+ of our stable artifact. The `Edge` artifact will always have the same version
48
+ number as the stable artifact it was created from, but with an `alpha` suffix.
49
+
50
+ For example, `5.0.0-alpha-1` is the `5.0.0` branch with `Edge` features included.
51
+ If there is a change to one of the `Edge` features we may regenerate the `Edge`
52
+ artifact and release a new `5.0.0-alpha-2`, new `Edge` artifacts simply increment
53
+ the number after the `alpha` suffix. All `Edge` features are considered
54
+ unstable and a backwards incompatible change in an `Edge` feature will not cause
55
+ any version change so you should take care when upgrading from one `alpha`
56
+ version to another.
57
+
58
+ Once an `Edge` feature has matured it will be considered `Mainline` and included
59
+ in the stable artifact, with a `MAJOR` or `MINOR` version bump.
60
+
61
+ To use an `Edge` artifact in your Ruby project you will have to make sure that
62
+ you pin the artifact with `alpha` stability in your `pom.xml`.
63
+
64
+ [semver]: http://semver.org/
@@ -1,6 +1,6 @@
1
1
  module Twilio
2
2
  module REST
3
- class TwilioException < Exception
3
+ class TwilioError < StandardError
4
4
  attr_reader :message, :body
5
5
 
6
6
  def initialize(message, body = nil)
@@ -13,7 +13,7 @@ module Twilio
13
13
  end
14
14
  end
15
15
 
16
- class RestException < TwilioException
16
+ class RestError < TwilioError
17
17
  attr_reader :message, :code, :status_code
18
18
 
19
19
  def initialize(message, code, status_code)
@@ -26,5 +26,6 @@ module Twilio
26
26
  "[HTTP #{status_code}] #{code} : #{message}"
27
27
  end
28
28
  end
29
+
29
30
  end
30
31
  end
@@ -28,7 +28,7 @@ module Twilio
28
28
 
29
29
  def process_response(response)
30
30
  if response.status_code != 200
31
- raise Twilio::REST::TwilioException.new('Unable to fetch page', response)
31
+ raise Twilio::REST::TwilioError.new('Unable to fetch page', response)
32
32
  end
33
33
 
34
34
  response.body
@@ -45,7 +45,7 @@ module Twilio
45
45
  end
46
46
  end
47
47
 
48
- raise Twilio::REST::TwilioException.new('Page Records can not be deserialized')
48
+ raise Twilio::REST::TwilioError.new('Page Records can not be deserialized')
49
49
  end
50
50
 
51
51
  def previous_page_url
@@ -69,7 +69,7 @@ module Twilio
69
69
  end
70
70
 
71
71
  def get_instance(payload)
72
- raise Twilio::REST::TwilioException.new('Page.get_instance() must be implemented in the derived class')
72
+ raise Twilio::REST::TwilioError.new('Page.get_instance() must be implemented in the derived class')
73
73
  end
74
74
 
75
75
  def previous_page
@@ -17,6 +17,15 @@ module Twilio
17
17
  end
18
18
  end
19
19
 
20
+ def self.serialize_object(object)
21
+ if object.is_a?(Hash) or object.is_a?(Array)
22
+ require 'json'
23
+ JSON.generate(object)
24
+ else
25
+ object
26
+ end
27
+ end
28
+
20
29
  def self.flatten(map, result={}, previous=[])
21
30
  map.each do |key, value|
22
31
  if value.is_a? Hash
@@ -74,7 +74,7 @@ module Twilio
74
74
  code = response.body['code']
75
75
  end
76
76
 
77
- return Twilio::REST::RestException.new(message, code, response.status_code)
77
+ return Twilio::REST::RestError.new(message, code, response.status_code)
78
78
  end
79
79
 
80
80
  def fetch(method, uri, params={}, data={}, headers={}, auth=nil, timeout=nil)
@@ -18,6 +18,7 @@ module Twilio
18
18
  end
19
19
 
20
20
  def request(host, port, method, url, params={}, data={}, headers={}, auth=nil, timeout=nil)
21
+ puts(url)
21
22
  @connection = Faraday.new(url: host + ":" + port.to_s, ssl: {verify: true}) do |f|
22
23
  f.request :url_encoded
23
24
  f.adapter @adapter
@@ -187,6 +187,34 @@ module Twilio
187
187
  end
188
188
  end
189
189
 
190
+ class TaskRouterGrant
191
+ attr_accessor :workspace_sid,
192
+ :worker_sid,
193
+ :role
194
+
195
+ def key
196
+ 'task_router'
197
+ end
198
+
199
+ def payload
200
+ payload = {}
201
+
202
+ if workspace_sid
203
+ payload[:workspace_sid] = workspace_sid
204
+ end
205
+
206
+ if worker_sid
207
+ payload[:worker_sid] = worker_sid
208
+ end
209
+
210
+ if role
211
+ payload[:role] = role
212
+ end
213
+
214
+ payload
215
+ end
216
+ end
217
+
190
218
 
191
219
  end
192
220
  end
@@ -9,13 +9,14 @@ module Twilio
9
9
  ##
10
10
  # A client for accessing the Twilio API.
11
11
  class Client
12
- attr_accessor :http_client, :username, :password, :account_sid, :auth_token
12
+ attr_accessor :http_client, :username, :password, :account_sid, :auth_token, :region
13
13
 
14
14
  ##
15
15
  # Initializes the Twilio Client
16
- def initialize(username=nil, password=nil, account_sid=nil, http_client=Twilio::HTTP::Client.new)
16
+ def initialize(username=nil, password=nil, account_sid=nil, region=nil, http_client=Twilio::HTTP::Client.new)
17
17
  @username = username || Twilio.account_sid
18
18
  @password = password || Twilio.auth_token
19
+ @region = region
19
20
  @account_sid = account_sid || @username
20
21
  @auth_token = @password
21
22
  @auth = [@username, @password]
@@ -36,6 +37,8 @@ module Twilio
36
37
  @trunking = nil
37
38
  @video = nil
38
39
  @messaging = nil
40
+ @wireless = nil
41
+ @sync = nil
39
42
  end
40
43
 
41
44
  ##
@@ -57,6 +60,13 @@ module Twilio
57
60
  headers['Accept'] = 'application/json'
58
61
  end
59
62
 
63
+ if !region.nil?
64
+ head, tail = uri.split('.', 2)
65
+ if !tail.start_with?(region)
66
+ uri = [head, region, tail].join('.')
67
+ end
68
+ end
69
+
60
70
  @http_client.request(
61
71
  host,
62
72
  port,
@@ -154,96 +164,108 @@ module Twilio
154
164
  @messaging ||= Messaging.new self
155
165
  end
156
166
 
157
- def addresses
158
- return self.api.v2010.account.addresses
167
+ ##
168
+ # Access the Wireless Twilio Domain
169
+ def wireless
170
+ @wireless ||= Wireless.new self
171
+ end
172
+
173
+ ##
174
+ # Access the Sync Twilio Domain
175
+ def sync
176
+ @sync ||= Sync.new self
177
+ end
178
+
179
+ def addresses(sid=:unset)
180
+ self.api.v2010.account.addresses(sid)
159
181
  end
160
182
 
161
- def applications
162
- return self.api.v2010.account.applications
183
+ def applications(sid=:unset)
184
+ self.api.v2010.account.applications(sid)
163
185
  end
164
186
 
165
- def authorized_connect_apps
166
- return self.api.v2010.account.authorized_connect_apps
187
+ def authorized_connect_apps(sid=:unset)
188
+ self.api.v2010.account.authorized_connect_apps(sid)
167
189
  end
168
190
 
169
- def available_phone_numbers
170
- return self.api.v2010.account.available_phone_numbers
191
+ def available_phone_numbers(sid=:unset)
192
+ self.api.v2010.account.available_phone_numbers(sid)
171
193
  end
172
194
 
173
- def calls
174
- return self.api.v2010.account.calls
195
+ def calls(sid=:unset)
196
+ self.api.v2010.account.calls(sid)
175
197
  end
176
198
 
177
- def conferences
178
- return self.api.v2010.account.conferences
199
+ def conferences(sid=:unset)
200
+ self.api.v2010.account.conferences(sid)
179
201
  end
180
202
 
181
- def connect_apps
182
- return self.api.v2010.account.connect_apps
203
+ def connect_apps(sid=:unset)
204
+ self.api.v2010.account.connect_apps(sid)
183
205
  end
184
206
 
185
- def incoming_phone_numbers
186
- return self.api.v2010.account.incoming_phone_numbers
207
+ def incoming_phone_numbers(sid=:unset)
208
+ self.api.v2010.account.incoming_phone_numbers(sid)
187
209
  end
188
210
 
189
- def keys
190
- return self.api.v2010.account.keys
211
+ def keys(sid=:unset)
212
+ self.api.v2010.account.keys(sid)
191
213
  end
192
214
 
193
- def messages
194
- return self.api.v2010.account.messages
215
+ def messages(sid=:unset)
216
+ self.api.v2010.account.messages(sid)
195
217
  end
196
218
 
197
219
  def new_keys
198
- return self.api.v2010.account.new_keys
220
+ self.api.v2010.account.new_keys
199
221
  end
200
222
 
201
223
  def new_signing_keys
202
- return self.api.v2010.account.new_signing_keys
224
+ self.api.v2010.account.new_signing_keys
203
225
  end
204
226
 
205
- def notifications
206
- return self.api.v2010.account.notifications
227
+ def notifications(sid=:unset)
228
+ self.api.v2010.account.notifications(sid)
207
229
  end
208
230
 
209
- def outgoing_caller_ids
210
- return self.api.v2010.account.outgoing_caller_ids
231
+ def outgoing_caller_ids(sid=:unset)
232
+ self.api.v2010.account.outgoing_caller_ids(sid)
211
233
  end
212
234
 
213
- def queues
214
- return self.api.v2010.account.queues
235
+ def queues(sid=:unset)
236
+ self.api.v2010.account.queues(sid)
215
237
  end
216
238
 
217
- def recordings
218
- return self.api.v2010.account.recordings
239
+ def recordings(sid=:unset)
240
+ self.api.v2010.account.recordings(sid)
219
241
  end
220
242
 
221
- def signing_keys
222
- return self.api.v2010.account.signing_keys
243
+ def signing_keys(sid=:unset)
244
+ self.api.v2010.account.signing_keys(sid)
223
245
  end
224
246
 
225
247
  def sip
226
- return self.api.v2010.account.sip
248
+ self.api.v2010.account.sip
227
249
  end
228
250
 
229
- def short_codes
230
- return self.api.v2010.account.short_codes
251
+ def short_codes(sid=:unset)
252
+ self.api.v2010.account.short_codes(sid)
231
253
  end
232
254
 
233
255
  def tokens
234
- return self.api.v2010.account.tokens
256
+ self.api.v2010.account.tokens
235
257
  end
236
258
 
237
- def transcriptions
238
- return self.api.v2010.account.transcriptions
259
+ def transcriptions(sid=:unset)
260
+ self.api.v2010.account.transcriptions(sid)
239
261
  end
240
262
 
241
263
  def usage
242
- return self.api.v2010.account.usage
264
+ self.api.v2010.account.usage
243
265
  end
244
266
 
245
267
  def validation_requests
246
- return self.api.v2010.account.validation_requests
268
+ self.api.v2010.account.validation_requests
247
269
  end
248
270
 
249
271
  ##
@@ -0,0 +1,303 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Fax < Domain
10
+ class V1 < Version
11
+ class FaxContext < InstanceContext
12
+ class FaxMediaList < ListResource
13
+ ##
14
+ # Initialize the FaxMediaList
15
+ # @param [Version] version Version that contains the resource
16
+ # @param [String] fax_sid The fax_sid
17
+ # @return [FaxMediaList] FaxMediaList
18
+ def initialize(version, fax_sid: nil)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {
23
+ fax_sid: fax_sid
24
+ }
25
+ @uri = "/Faxes/#{@solution[:fax_sid]}/Media"
26
+ end
27
+
28
+ ##
29
+ # Lists FaxMediaInstance records from the API as a list.
30
+ # Unlike stream(), this operation is eager and will load `limit` records into
31
+ # memory before returning.
32
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
33
+ # guarantees to never return more than limit. Default is no limit
34
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
35
+ # the default value of 50 records. If no page_size is defined
36
+ # but a limit is defined, stream() will attempt to read the
37
+ # limit with the most efficient page size, i.e. min(limit, 1000)
38
+ # @return [Array] Array of up to limit results
39
+ def list(limit: nil, page_size: nil)
40
+ self.stream(
41
+ limit: limit,
42
+ page_size: page_size
43
+ ).entries
44
+ end
45
+
46
+ ##
47
+ # Streams FaxMediaInstance records from the API as an Enumerable.
48
+ # This operation lazily loads records as efficiently as possible until the limit
49
+ # is reached.
50
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
51
+ # guarantees to never return more than limit. Default is no limit
52
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
53
+ # the default value of 50 records. If no page_size is defined
54
+ # but a limit is defined, stream() will attempt to read the
55
+ # limit with the most efficient page size, i.e. min(limit, 1000)
56
+ # @return [Enumerable] Enumerable that will yield up to limit results
57
+ def stream(limit: nil, page_size: nil)
58
+ limits = @version.read_limits(limit, page_size)
59
+
60
+ page = self.page(
61
+ page_size: limits[:page_size],
62
+ )
63
+
64
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
65
+ end
66
+
67
+ ##
68
+ # When passed a block, yields FaxMediaInstance records from the API.
69
+ # This operation lazily loads records as efficiently as possible until the limit
70
+ # is reached.
71
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
72
+ # guarantees to never return more than limit. Default is no limit
73
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
74
+ # the default value of 50 records. If no page_size is defined
75
+ # but a limit is defined, stream() will attempt to read the
76
+ # limit with the most efficient page size, i.e. min(limit, 1000)
77
+ def each
78
+ limits = @version.read_limits
79
+
80
+ page = self.page(
81
+ page_size: limits[:page_size],
82
+ )
83
+
84
+ @version.stream(page,
85
+ limit: limits[:limit],
86
+ page_limit: limits[:page_limit]).each {|x| yield x}
87
+ end
88
+
89
+ ##
90
+ # Retrieve a single page of FaxMediaInstance records from the API.
91
+ # Request is executed immediately.
92
+ # @param [String] page_token PageToken provided by the API
93
+ # @param [Integer] page_number Page Number, this value is simply for client state
94
+ # @param [Integer] page_size Number of records to return, defaults to 50
95
+ # @return [Page] Page of FaxMediaInstance
96
+ def page(page_token: nil, page_number: nil, page_size: nil)
97
+ params = {
98
+ 'PageToken' => page_token,
99
+ 'Page' => page_number,
100
+ 'PageSize' => page_size,
101
+ }
102
+ response = @version.page(
103
+ 'GET',
104
+ @uri,
105
+ params
106
+ )
107
+ return FaxMediaPage.new(@version, response, @solution)
108
+ end
109
+
110
+ ##
111
+ # Provide a user friendly representation
112
+ def to_s
113
+ '#<Twilio.Fax.V1.FaxMediaList>'
114
+ end
115
+ end
116
+
117
+ class FaxMediaPage < Page
118
+ ##
119
+ # Initialize the FaxMediaPage
120
+ # @param [Version] version Version that contains the resource
121
+ # @param [Response] response Response from the API
122
+ # @param [Hash] solution Path solution for the resource
123
+ # @param [String] fax_sid The fax_sid
124
+ # @return [FaxMediaPage] FaxMediaPage
125
+ def initialize(version, response, solution)
126
+ super(version, response)
127
+
128
+ # Path Solution
129
+ @solution = solution
130
+ end
131
+
132
+ ##
133
+ # Build an instance of FaxMediaInstance
134
+ # @param [Hash] payload Payload response from the API
135
+ # @return [FaxMediaInstance] FaxMediaInstance
136
+ def get_instance(payload)
137
+ return FaxMediaInstance.new(
138
+ @version,
139
+ payload,
140
+ fax_sid: @solution[:fax_sid],
141
+ )
142
+ end
143
+
144
+ ##
145
+ # Provide a user friendly representation
146
+ def to_s
147
+ '<Twilio.Fax.V1.FaxMediaPage>'
148
+ end
149
+ end
150
+
151
+ class FaxMediaContext < InstanceContext
152
+ ##
153
+ # Initialize the FaxMediaContext
154
+ # @param [Version] version Version that contains the resource
155
+ # @param [String] fax_sid The fax_sid
156
+ # @param [String] sid The sid
157
+ # @return [FaxMediaContext] FaxMediaContext
158
+ def initialize(version, fax_sid, sid)
159
+ super(version)
160
+
161
+ # Path Solution
162
+ @solution = {
163
+ fax_sid: fax_sid,
164
+ sid: sid,
165
+ }
166
+ @uri = "/Faxes/#{@solution[:fax_sid]}/Media/#{@solution[:sid]}"
167
+ end
168
+
169
+ ##
170
+ # Fetch a FaxMediaInstance
171
+ # @return [FaxMediaInstance] Fetched FaxMediaInstance
172
+ def fetch
173
+ params = {}
174
+
175
+ payload = @version.fetch(
176
+ 'GET',
177
+ @uri,
178
+ params,
179
+ )
180
+
181
+ return FaxMediaInstance.new(
182
+ @version,
183
+ payload,
184
+ fax_sid: @solution[:fax_sid],
185
+ sid: @solution[:sid],
186
+ )
187
+ end
188
+
189
+ ##
190
+ # Deletes the FaxMediaInstance
191
+ # @return [Boolean] true if delete succeeds, true otherwise
192
+ def delete
193
+ return @version.delete('delete', @uri)
194
+ end
195
+
196
+ ##
197
+ # Provide a user friendly representation
198
+ def to_s
199
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
200
+ "#<Twilio.Fax.V1.FaxMediaContext #{context}>"
201
+ end
202
+ end
203
+
204
+ class FaxMediaInstance < InstanceResource
205
+ ##
206
+ # Initialize the FaxMediaInstance
207
+ # @param [Version] version Version that contains the resource
208
+ # @param [Hash] payload payload that contains response from Twilio
209
+ # @param [String] fax_sid The fax_sid
210
+ # @param [String] sid The sid
211
+ # @return [FaxMediaInstance] FaxMediaInstance
212
+ def initialize(version, payload, fax_sid: nil, sid: nil)
213
+ super(version)
214
+
215
+ # Marshaled Properties
216
+ @properties = {
217
+ 'sid' => payload['sid'],
218
+ 'account_sid' => payload['account_sid'],
219
+ 'fax_sid' => payload['fax_sid'],
220
+ 'content_type' => payload['content_type'],
221
+ 'date_created' => Twilio.deserialize_iso8601(payload['date_created']),
222
+ 'date_updated' => Twilio.deserialize_iso8601(payload['date_updated']),
223
+ 'url' => payload['url'],
224
+ }
225
+
226
+ # Context
227
+ @instance_context = nil
228
+ @params = {
229
+ 'fax_sid' => fax_sid,
230
+ 'sid' => sid || @properties['sid'],
231
+ }
232
+ end
233
+
234
+ ##
235
+ # Generate an instance context for the instance, the context is capable of
236
+ # performing various actions. All instance actions are proxied to the context
237
+ # @param [Version] version Version that contains the resource
238
+ # @return [FaxMediaContext] FaxMediaContext for this FaxMediaInstance
239
+ def context
240
+ unless @instance_context
241
+ @instance_context = FaxMediaContext.new(
242
+ @version,
243
+ @params['fax_sid'],
244
+ @params['sid'],
245
+ )
246
+ end
247
+ @instance_context
248
+ end
249
+
250
+ def sid
251
+ @properties['sid']
252
+ end
253
+
254
+ def account_sid
255
+ @properties['account_sid']
256
+ end
257
+
258
+ def fax_sid
259
+ @properties['fax_sid']
260
+ end
261
+
262
+ def content_type
263
+ @properties['content_type']
264
+ end
265
+
266
+ def date_created
267
+ @properties['date_created']
268
+ end
269
+
270
+ def date_updated
271
+ @properties['date_updated']
272
+ end
273
+
274
+ def url
275
+ @properties['url']
276
+ end
277
+
278
+ ##
279
+ # Fetch a FaxMediaInstance
280
+ # @return [FaxMediaInstance] Fetched FaxMediaInstance
281
+ def fetch
282
+ context.fetch
283
+ end
284
+
285
+ ##
286
+ # Deletes the FaxMediaInstance
287
+ # @return [Boolean] true if delete succeeds, true otherwise
288
+ def delete
289
+ context.delete
290
+ end
291
+
292
+ ##
293
+ # Provide a user friendly representation
294
+ def to_s
295
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
296
+ "<Twilio.Fax.V1.FaxMediaInstance #{values}>"
297
+ end
298
+ end
299
+ end
300
+ end
301
+ end
302
+ end
303
+ end