twilio-ruby 5.0.0.rc4 → 5.0.0.rc5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +8 -1
  3. data/Makefile +3 -0
  4. data/lib/twilio-ruby.rb +0 -1
  5. data/lib/twilio-ruby/framework/version.rb +4 -4
  6. data/lib/twilio-ruby/rest/api/v2010/account.rb +0 -13
  7. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +0 -13
  8. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +0 -14
  9. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +0 -13
  10. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +0 -13
  11. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +0 -13
  12. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +0 -11
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +0 -13
  14. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +0 -14
  15. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +0 -14
  16. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +0 -13
  17. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +0 -14
  18. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +0 -13
  19. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +0 -14
  20. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +0 -13
  21. data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +0 -14
  22. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +0 -13
  23. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +0 -14
  24. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +0 -13
  25. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +0 -14
  26. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +0 -13
  27. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +0 -14
  28. data/lib/twilio-ruby/rest/api/v2010/account/sandbox.rb +0 -10
  29. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +0 -13
  30. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +0 -14
  31. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +0 -13
  32. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +0 -14
  33. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +0 -14
  34. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +0 -14
  35. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +0 -14
  36. data/lib/twilio-ruby/rest/api/v2010/account/sms/short_code.rb +0 -13
  37. data/lib/twilio-ruby/rest/api/v2010/account/sms/sms_message.rb +0 -13
  38. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +0 -13
  39. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +0 -13
  40. data/lib/twilio-ruby/rest/client.rb +7 -7
  41. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +0 -12
  42. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +0 -12
  43. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +0 -13
  44. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +0 -14
  45. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +0 -14
  46. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +0 -13
  47. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +0 -18
  48. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +0 -12
  49. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +0 -12
  50. data/lib/twilio-ruby/rest/monitor/v1/event.rb +0 -12
  51. data/lib/twilio-ruby/rest/notifications.rb +4 -0
  52. data/lib/twilio-ruby/rest/notifications/v1.rb +9 -0
  53. data/lib/twilio-ruby/rest/notifications/v1/credential.rb +390 -0
  54. data/lib/twilio-ruby/rest/notifications/v1/service.rb +0 -12
  55. data/lib/twilio-ruby/rest/notifications/v1/service/binding.rb +0 -13
  56. data/lib/twilio-ruby/rest/preview.rb +47 -0
  57. data/lib/twilio-ruby/rest/preview/wireless.rb +53 -0
  58. data/lib/twilio-ruby/rest/preview/wireless/command.rb +345 -0
  59. data/lib/twilio-ruby/rest/preview/wireless/device.rb +456 -0
  60. data/lib/twilio-ruby/rest/preview/wireless/device/usage.rb +227 -0
  61. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +325 -0
  62. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +0 -12
  63. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +0 -12
  64. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +0 -12
  65. data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +0 -12
  66. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +0 -12
  67. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +0 -13
  68. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +0 -13
  69. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +0 -13
  70. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +0 -14
  71. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +0 -13
  72. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +0 -11
  73. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +0 -13
  74. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +0 -11
  75. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +0 -10
  76. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +0 -13
  77. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +0 -11
  78. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +0 -10
  79. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +0 -12
  80. data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +0 -13
  81. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +0 -13
  82. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +0 -13
  83. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +0 -13
  84. data/lib/twilio-ruby/version.rb +1 -1
  85. data/spec/integration/api/v2010/account/usage/trigger_spec.rb +3 -3
  86. data/spec/integration/ip_messaging/v1/credential_spec.rb +1 -1
  87. data/spec/integration/ip_messaging/v1/service/role_spec.rb +1 -1
  88. data/spec/integration/notifications/v1/credential_spec.rb +228 -0
  89. data/spec/integration/notifications/v1/service/binding_spec.rb +2 -2
  90. data/spec/integration/preview/wireless/command_spec.rb +58 -0
  91. data/spec/integration/preview/wireless/device/usage_spec.rb +25 -0
  92. data/spec/integration/preview/wireless/device_spec.rb +72 -0
  93. data/spec/integration/preview/wireless/rate_plan_spec.rb +39 -0
  94. metadata +19 -16
  95. data/lib/twilio-ruby/rest/conversations.rb +0 -40
  96. data/lib/twilio-ruby/rest/conversations/v1.rb +0 -35
  97. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +0 -270
  98. data/lib/twilio-ruby/rest/conversations/v1/conversation/completed.rb +0 -217
  99. data/lib/twilio-ruby/rest/conversations/v1/conversation/in_progress.rb +0 -217
  100. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +0 -352
  101. data/spec/integration/conversations/v1/conversation/completed_spec.rb +0 -89
  102. data/spec/integration/conversations/v1/conversation/in_progress_spec.rb +0 -89
  103. data/spec/integration/conversations/v1/conversation/participant_spec.rb +0 -174
  104. data/spec/integration/conversations/v1/conversation_spec.rb +0 -49
@@ -147,18 +147,6 @@ module Twilio
147
147
  return ServicePage.new(@version, response, @solution)
148
148
  end
149
149
 
150
- ##
151
- # Constructs a ServiceContext
152
- # @param [String] sid The sid
153
-
154
- # @return [ServiceContext] ServiceContext
155
- def get(sid)
156
- ServiceContext.new(
157
- @version,
158
- sid: sid,
159
- )
160
- end
161
-
162
150
  ##
163
151
  # Provide a user friendly representation
164
152
  def to_s
@@ -201,19 +201,6 @@ module Twilio
201
201
  return BindingPage.new(@version, response, @solution)
202
202
  end
203
203
 
204
- ##
205
- # Constructs a BindingContext
206
- # @param [String] sid The sid
207
-
208
- # @return [BindingContext] BindingContext
209
- def get(sid)
210
- BindingContext.new(
211
- @version,
212
- service_sid: @solution[:service_sid],
213
- sid: sid,
214
- )
215
- end
216
-
217
204
  ##
218
205
  # Provide a user friendly representation
219
206
  def to_s
@@ -0,0 +1,47 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview < Domain
10
+ ##
11
+ # Initialize the Preview Domain
12
+ def initialize(twilio)
13
+ super
14
+
15
+ @base_url = 'https://preview.twilio.com'
16
+ @host = 'preview.twilio.com'
17
+ @port = 443
18
+
19
+ @wireless = nil
20
+ end
21
+
22
+ ##
23
+ # Version wireless of preview
24
+ def wireless
25
+ @wireless ||= Wireless.new self
26
+ end
27
+
28
+ def commands
29
+ self.wireless.commands
30
+ end
31
+
32
+ def devices
33
+ self.wireless.devices
34
+ end
35
+
36
+ def rate_plans
37
+ self.wireless.rate_plans
38
+ end
39
+
40
+ ##
41
+ # Provide a user friendly representation
42
+ def to_s
43
+ '#<Twilio::REST::Preview>'
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,53 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview
10
+ class Wireless < Version
11
+ ##
12
+ # Initialize the Wireless version of Preview
13
+ def initialize(domain)
14
+ super
15
+ @version = 'wireless'
16
+ @commands = nil
17
+ @devices = nil
18
+ @rate_plans = nil
19
+ end
20
+
21
+ def commands(sid=:unset)
22
+ if sid == :unset
23
+ @commands ||= CommandList.new self
24
+ else
25
+ CommandContext.new(self, sid)
26
+ end
27
+ end
28
+
29
+ def devices(sid=:unset)
30
+ if sid == :unset
31
+ @devices ||= DeviceList.new self
32
+ else
33
+ DeviceContext.new(self, sid)
34
+ end
35
+ end
36
+
37
+ def rate_plans(sid=:unset)
38
+ if sid == :unset
39
+ @rate_plans ||= RatePlanList.new self
40
+ else
41
+ RatePlanContext.new(self, sid)
42
+ end
43
+ end
44
+
45
+ ##
46
+ # Provide a user friendly representation
47
+ def to_s
48
+ #<Twilio::REST::Preview::Wireless>
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,345 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview < Domain
10
+ class Wireless < Version
11
+ class CommandList < ListResource
12
+ ##
13
+ # Initialize the CommandList
14
+ # @param [Version] version Version that contains the resource
15
+
16
+ # @return [CommandList] CommandList
17
+ def initialize(version)
18
+ super(version)
19
+
20
+ # Path Solution
21
+ @solution = {}
22
+ @uri = "/Commands"
23
+ end
24
+
25
+ ##
26
+ # Lists CommandInstance records from the API as a list.
27
+ # Unlike stream(), this operation is eager and will load `limit` records into
28
+ # memory before returning.
29
+ # @param [String] device The device
30
+ # @param [String] status The status
31
+ # @param [String] direction The direction
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
+
39
+ # @return [Array] Array of up to limit results
40
+ def list(device: nil, status: nil, direction: nil, limit: nil, page_size: nil)
41
+ self.stream(
42
+ device: device,
43
+ status: status,
44
+ direction: direction,
45
+ limit: limit,
46
+ page_size: page_size
47
+ ).entries
48
+ end
49
+
50
+ ##
51
+ # Streams CommandInstance records from the API as an Enumerable.
52
+ # This operation lazily loads records as efficiently as possible until the limit
53
+ # is reached.
54
+ # @param [String] device The device
55
+ # @param [String] status The status
56
+ # @param [String] direction The direction
57
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
58
+ # guarantees to never return more than limit. Default is no limit
59
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
60
+ # the default value of 50 records. If no page_size is defined
61
+ # but a limit is defined, stream() will attempt to read the
62
+ # limit with the most efficient page size, i.e. min(limit, 1000)
63
+
64
+ # @return [Enumerable] Enumerable that will yield up to limit results
65
+ def stream(device: nil, status: nil, direction: nil, limit: nil, page_size: nil)
66
+ limits = @version.read_limits(limit, page_size)
67
+
68
+ page = self.page(
69
+ device: device,
70
+ status: status,
71
+ direction: direction,
72
+ page_size: limits['page_size'],
73
+ )
74
+
75
+ @version.stream(page, limit: limits['limit'], page_limit: limits['page_limit'])
76
+ end
77
+
78
+ ##
79
+ # When passed a block, yields CommandInstance records from the API.
80
+ # This operation lazily loads records as efficiently as possible until the limit
81
+ # is reached.
82
+ # @param [String] device The device
83
+ # @param [String] status The status
84
+ # @param [String] direction The direction
85
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
86
+ # guarantees to never return more than limit. Default is no limit
87
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
88
+ # the default value of 50 records. If no page_size is defined
89
+ # but a limit is defined, stream() will attempt to read the
90
+ # limit with the most efficient page size, i.e. min(limit, 1000)
91
+ def each
92
+ limits = @version.read_limits
93
+
94
+ page = self.page(
95
+ page_size: limits['page_size'],
96
+ )
97
+
98
+ @version.stream(page,
99
+ limit: limits['limit'],
100
+ page_limit: limits['page_limit']).each {|x| yield x}
101
+ end
102
+
103
+ ##
104
+ # Retrieve a single page of CommandInstance records from the API.
105
+ # Request is executed immediately.
106
+ # @param [String] device The device
107
+ # @param [String] status The status
108
+ # @param [String] direction The direction
109
+ # @param [String] page_token PageToken provided by the API
110
+ # @param [Integer] page_number Page Number, this value is simply for client state
111
+ # @param [Integer] page_size Number of records to return, defaults to 50
112
+
113
+ # @return [Page] Page of CommandInstance
114
+ def page(device: nil, status: nil, direction: nil, page_token: nil, page_number: nil, page_size: nil)
115
+ params = {
116
+ 'Device' => device,
117
+ 'Status' => status,
118
+ 'Direction' => direction,
119
+ 'PageToken' => page_token,
120
+ 'Page' => page_number,
121
+ 'PageSize' => page_size,
122
+ }
123
+ response = @version.page(
124
+ 'GET',
125
+ @uri,
126
+ params
127
+ )
128
+ return CommandPage.new(@version, response, @solution)
129
+ end
130
+
131
+ ##
132
+ # Retrieve a single page of CommandInstance records from the API.
133
+ # Request is executed immediately.
134
+ # @param [String] device The device
135
+ # @param [String] command The command
136
+ # @param [String] callback_method The callback_method
137
+ # @param [String] callback_url The callback_url
138
+
139
+ # @return [CommandInstance] Newly created CommandInstance
140
+ def create(device: nil, command: nil, callback_method: nil, callback_url: nil)
141
+ data = {
142
+ 'Device' => device,
143
+ 'Command' => command,
144
+ 'CallbackMethod' => callback_method,
145
+ 'CallbackUrl' => callback_url,
146
+ }
147
+
148
+ payload = @version.create(
149
+ 'POST',
150
+ @uri,
151
+ data: data
152
+ )
153
+
154
+ return CommandInstance.new(
155
+ @version,
156
+ payload,
157
+ )
158
+ end
159
+
160
+ ##
161
+ # Provide a user friendly representation
162
+ def to_s
163
+ '#<Twilio.Preview.Wireless.CommandList>'
164
+ end
165
+ end
166
+
167
+ class CommandPage < Page
168
+ ##
169
+ # Initialize the CommandPage
170
+ # @param [Version] version Version that contains the resource
171
+ # @param [Response] response Response from the API
172
+ # @param [Hash] solution Path solution for the resource
173
+
174
+ # @return [CommandPage] CommandPage
175
+ def initialize(version, response, solution)
176
+ super(version, response)
177
+
178
+ # Path Solution
179
+ @solution = solution
180
+ end
181
+
182
+ ##
183
+ # Build an instance of CommandInstance
184
+ # @param [Hash] payload Payload response from the API
185
+
186
+ # @return [CommandInstance] CommandInstance
187
+ def get_instance(payload)
188
+ return CommandInstance.new(
189
+ @version,
190
+ payload,
191
+ )
192
+ end
193
+
194
+ ##
195
+ # Provide a user friendly representation
196
+ def to_s
197
+ '<Twilio.Preview.Wireless.CommandPage>'
198
+ end
199
+ end
200
+
201
+ class CommandContext < InstanceContext
202
+ ##
203
+ # Initialize the CommandContext
204
+ # @param [Version] version Version that contains the resource
205
+ # @param [String] sid The sid
206
+
207
+ # @return [CommandContext] CommandContext
208
+ def initialize(version, sid)
209
+ super(version)
210
+
211
+ # Path Solution
212
+ @solution = {
213
+ sid: sid,
214
+ }
215
+ @uri = "/Commands/#{@solution[:sid]}"
216
+ end
217
+
218
+ ##
219
+ # Fetch a CommandInstance
220
+ # @return [CommandInstance] Fetched CommandInstance
221
+ def fetch
222
+ params = {}
223
+
224
+ payload = @version.fetch(
225
+ 'GET',
226
+ @uri,
227
+ params,
228
+ )
229
+
230
+ return CommandInstance.new(
231
+ @version,
232
+ payload,
233
+ sid: @solution['sid'],
234
+ )
235
+ end
236
+
237
+ ##
238
+ # Provide a user friendly representation
239
+ def to_s
240
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
241
+ "#<Twilio.Preview.Wireless.CommandContext #{context}>"
242
+ end
243
+ end
244
+
245
+ class CommandInstance < InstanceResource
246
+ ##
247
+ # Initialize the CommandInstance
248
+ # @param [Version] version Version that contains the resource
249
+ # @param [Hash] payload payload that contains response from Twilio
250
+ # @param [String] sid The sid
251
+
252
+ # @return [CommandInstance] CommandInstance
253
+ def initialize(version, payload, sid: nil)
254
+ super(version)
255
+
256
+ # Marshaled Properties
257
+ @properties = {
258
+ 'sid' => payload['sid'],
259
+ 'account_sid' => payload['account_sid'],
260
+ 'device_sid' => payload['device_sid'],
261
+ 'command' => payload['command'],
262
+ 'status' => payload['status'],
263
+ 'direction' => payload['direction'],
264
+ 'date_created' => Twilio.deserialize_iso8601(payload['date_created']),
265
+ 'date_updated' => Twilio.deserialize_iso8601(payload['date_updated']),
266
+ 'url' => payload['url'],
267
+ }
268
+
269
+ # Context
270
+ @instance_context = nil
271
+ @params = {
272
+ 'sid' => sid || @properties['sid'],
273
+ }
274
+ end
275
+
276
+ ##
277
+ # Generate an instance context for the instance, the context is capable of
278
+ # performing various actions. All instance actions are proxied to the context
279
+ # @param [Version] version Version that contains the resource
280
+
281
+ # @return [CommandContext] CommandContext for this CommandInstance
282
+ def context
283
+ unless @instance_context
284
+ @instance_context = CommandContext.new(
285
+ @version,
286
+ @params['sid'],
287
+ )
288
+ end
289
+ @instance_context
290
+ end
291
+
292
+ def sid
293
+ @properties['sid']
294
+ end
295
+
296
+ def account_sid
297
+ @properties['account_sid']
298
+ end
299
+
300
+ def device_sid
301
+ @properties['device_sid']
302
+ end
303
+
304
+ def command
305
+ @properties['command']
306
+ end
307
+
308
+ def status
309
+ @properties['status']
310
+ end
311
+
312
+ def direction
313
+ @properties['direction']
314
+ end
315
+
316
+ def date_created
317
+ @properties['date_created']
318
+ end
319
+
320
+ def date_updated
321
+ @properties['date_updated']
322
+ end
323
+
324
+ def url
325
+ @properties['url']
326
+ end
327
+
328
+ ##
329
+ # Fetch a CommandInstance
330
+ # @return [CommandInstance] Fetched CommandInstance
331
+ def fetch
332
+ @context.fetch()
333
+ end
334
+
335
+ ##
336
+ # Provide a user friendly representation
337
+ def to_s
338
+ context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
339
+ "<Twilio.Preview.Wireless.CommandInstance #{context}>"
340
+ end
341
+ end
342
+ end
343
+ end
344
+ end
345
+ end