twilio-ruby 5.0.0.rc9 → 5.0.0.rc10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +2 -9
  3. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +13 -24
  4. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +12 -23
  5. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +6 -15
  6. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -9
  7. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -9
  8. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -9
  9. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +9 -18
  10. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +15 -23
  11. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +8 -15
  12. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +9 -18
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +9 -18
  14. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +20 -28
  15. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +15 -24
  16. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +7 -16
  17. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +10 -20
  18. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +2 -10
  19. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +2 -10
  20. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +2 -10
  21. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +12 -23
  22. data/lib/twilio-ruby/rest/api/v2010/account/key.rb +324 -0
  23. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +4 -9
  24. data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +9 -18
  25. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +23 -29
  26. data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +145 -0
  27. data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +145 -0
  28. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +7 -16
  29. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +12 -21
  30. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +13 -23
  31. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +13 -24
  32. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +9 -18
  33. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +8 -17
  34. data/lib/twilio-ruby/rest/api/v2010/account/sandbox.rb +8 -15
  35. data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +324 -0
  36. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +16 -27
  37. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +14 -24
  38. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -21
  39. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -21
  40. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +23 -31
  41. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +16 -27
  42. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +14 -24
  43. data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +1 -8
  44. data/lib/twilio-ruby/rest/api/v2010/account/sms/short_code.rb +10 -20
  45. data/lib/twilio-ruby/rest/api/v2010/account/sms/sms_message.rb +13 -23
  46. data/lib/twilio-ruby/rest/api/v2010/account/sms.rb +1 -7
  47. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +2 -7
  48. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +7 -16
  49. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -8
  50. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -8
  51. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -8
  52. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -8
  53. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -8
  54. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -8
  55. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -8
  56. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -8
  57. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -8
  58. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +12 -23
  59. data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +1 -6
  60. data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +2 -7
  61. data/lib/twilio-ruby/rest/api/v2010/account.rb +131 -38
  62. data/lib/twilio-ruby/rest/api/v2010.rb +17 -1
  63. data/lib/twilio-ruby/rest/api.rb +16 -0
  64. data/lib/twilio-ruby/rest/client.rb +16 -0
  65. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +13 -28
  66. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +11 -21
  67. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +62 -20
  68. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +17 -28
  69. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +12 -23
  70. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +23 -25
  71. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +13 -24
  72. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +1 -1
  73. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +5 -12
  74. data/lib/twilio-ruby/rest/lookups/v1.rb +1 -1
  75. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +5 -14
  76. data/lib/twilio-ruby/rest/monitor/v1/event.rb +4 -13
  77. data/lib/twilio-ruby/rest/monitor/v1.rb +1 -1
  78. data/lib/twilio-ruby/rest/notifications/v1/credential.rb +13 -28
  79. data/lib/twilio-ruby/rest/notifications/v1/service/binding.rb +8 -18
  80. data/lib/twilio-ruby/rest/notifications/v1/service/notification.rb +8 -8
  81. data/lib/twilio-ruby/rest/notifications/v1/service.rb +10 -21
  82. data/lib/twilio-ruby/rest/notifications/v1.rb +1 -1
  83. data/lib/twilio-ruby/rest/preview/wireless/command.rb +4 -14
  84. data/lib/twilio-ruby/rest/preview/wireless/device/usage.rb +6 -13
  85. data/lib/twilio-ruby/rest/preview/wireless/device.rb +8 -19
  86. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +4 -13
  87. data/lib/twilio-ruby/rest/preview/wireless.rb +1 -1
  88. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +4 -13
  89. data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +0 -5
  90. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +4 -13
  91. data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +0 -5
  92. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +4 -13
  93. data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +4 -10
  94. data/lib/twilio-ruby/rest/pricing/v1/voice.rb +0 -6
  95. data/lib/twilio-ruby/rest/pricing/v1.rb +1 -1
  96. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +13 -23
  97. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +6 -15
  98. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +13 -23
  99. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +13 -24
  100. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +8 -15
  101. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +1 -8
  102. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +13 -24
  103. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +8 -15
  104. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +6 -13
  105. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +13 -24
  106. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +8 -15
  107. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +13 -24
  108. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +6 -13
  109. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +15 -26
  110. data/lib/twilio-ruby/rest/taskrouter/v1.rb +1 -1
  111. data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +8 -18
  112. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +8 -18
  113. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +12 -23
  114. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +8 -18
  115. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +12 -23
  116. data/lib/twilio-ruby/rest/trunking/v1.rb +1 -1
  117. data/lib/twilio-ruby/version.rb +1 -1
  118. data/spec/integration/api/v2010/account/key_spec.rb +178 -0
  119. data/spec/integration/api/v2010/account/message_spec.rb +2 -3
  120. data/spec/integration/api/v2010/account/new_key_spec.rb +45 -0
  121. data/spec/integration/api/v2010/account/new_signing_key_spec.rb +45 -0
  122. data/spec/integration/api/v2010/account/signing_key_spec.rb +178 -0
  123. data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +3 -7
  124. data/spec/integration/ip_messaging/v1/credential_spec.rb +5 -10
  125. data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +37 -0
  126. data/spec/integration/ip_messaging/v1/service/channel_spec.rb +3 -7
  127. data/spec/integration/ip_messaging/v1/service/user_spec.rb +3 -6
  128. data/spec/integration/notifications/v1/credential_spec.rb +5 -10
  129. data/spec/integration/notifications/v1/service/notification_spec.rb +1 -0
  130. data/spec/integration/preview/wireless/device_spec.rb +4 -4
  131. data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +3 -6
  132. metadata +15 -3
@@ -15,7 +15,6 @@ module Twilio
15
15
  # Initialize the TaskQueuesStatisticsList
16
16
  # @param [Version] version Version that contains the resource
17
17
  # @param [String] workspace_sid The workspace_sid
18
-
19
18
  # @return [TaskQueuesStatisticsList] TaskQueuesStatisticsList
20
19
  def initialize(version, workspace_sid: nil)
21
20
  super(version)
@@ -41,7 +40,6 @@ module Twilio
41
40
  # the default value of 50 records. If no page_size is defined
42
41
  # but a limit is defined, stream() will attempt to read the
43
42
  # limit with the most efficient page size, i.e. min(limit, 1000)
44
-
45
43
  # @return [Array] Array of up to limit results
46
44
  def list(end_date: nil, friendly_name: nil, minutes: nil, start_date: nil, limit: nil, page_size: nil)
47
45
  self.stream(
@@ -68,7 +66,6 @@ module Twilio
68
66
  # the default value of 50 records. If no page_size is defined
69
67
  # but a limit is defined, stream() will attempt to read the
70
68
  # limit with the most efficient page size, i.e. min(limit, 1000)
71
-
72
69
  # @return [Enumerable] Enumerable that will yield up to limit results
73
70
  def stream(end_date: nil, friendly_name: nil, minutes: nil, start_date: nil, limit: nil, page_size: nil)
74
71
  limits = @version.read_limits(limit, page_size)
@@ -120,7 +117,6 @@ module Twilio
120
117
  # @param [String] page_token PageToken provided by the API
121
118
  # @param [Integer] page_number Page Number, this value is simply for client state
122
119
  # @param [Integer] page_size Number of records to return, defaults to 50
123
-
124
120
  # @return [Page] Page of TaskQueuesStatisticsInstance
125
121
  def page(end_date: nil, friendly_name: nil, minutes: nil, start_date: nil, page_token: nil, page_number: nil, page_size: nil)
126
122
  params = {
@@ -154,7 +150,6 @@ module Twilio
154
150
  # @param [Response] response Response from the API
155
151
  # @param [Hash] solution Path solution for the resource
156
152
  # @param [String] workspace_sid The workspace_sid
157
-
158
153
  # @return [TaskQueuesStatisticsPage] TaskQueuesStatisticsPage
159
154
  def initialize(version, response, solution)
160
155
  super(version, response)
@@ -166,13 +161,12 @@ module Twilio
166
161
  ##
167
162
  # Build an instance of TaskQueuesStatisticsInstance
168
163
  # @param [Hash] payload Payload response from the API
169
-
170
164
  # @return [TaskQueuesStatisticsInstance] TaskQueuesStatisticsInstance
171
165
  def get_instance(payload)
172
166
  return TaskQueuesStatisticsInstance.new(
173
167
  @version,
174
168
  payload,
175
- workspace_sid: @solution['workspace_sid'],
169
+ workspace_sid: @solution[:workspace_sid],
176
170
  )
177
171
  end
178
172
 
@@ -189,7 +183,6 @@ module Twilio
189
183
  # @param [Version] version Version that contains the resource
190
184
  # @param [Hash] payload payload that contains response from Twilio
191
185
  # @param [String] workspace_sid The workspace_sid
192
-
193
186
  # @return [TaskQueuesStatisticsInstance] TaskQueuesStatisticsInstance
194
187
  def initialize(version, payload, workspace_sid: nil)
195
188
  super(version)
@@ -14,7 +14,6 @@ module Twilio
14
14
  # Initialize the TaskQueueList
15
15
  # @param [Version] version Version that contains the resource
16
16
  # @param [String] workspace_sid The workspace_sid
17
-
18
17
  # @return [TaskQueueList] TaskQueueList
19
18
  def initialize(version, workspace_sid: nil)
20
19
  super(version)
@@ -41,7 +40,6 @@ module Twilio
41
40
  # the default value of 50 records. If no page_size is defined
42
41
  # but a limit is defined, stream() will attempt to read the
43
42
  # limit with the most efficient page size, i.e. min(limit, 1000)
44
-
45
43
  # @return [Array] Array of up to limit results
46
44
  def list(friendly_name: nil, evaluate_worker_attributes: nil, limit: nil, page_size: nil)
47
45
  self.stream(
@@ -64,7 +62,6 @@ module Twilio
64
62
  # the default value of 50 records. If no page_size is defined
65
63
  # but a limit is defined, stream() will attempt to read the
66
64
  # limit with the most efficient page size, i.e. min(limit, 1000)
67
-
68
65
  # @return [Enumerable] Enumerable that will yield up to limit results
69
66
  def stream(friendly_name: nil, evaluate_worker_attributes: nil, limit: nil, page_size: nil)
70
67
  limits = @version.read_limits(limit, page_size)
@@ -110,7 +107,6 @@ module Twilio
110
107
  # @param [String] page_token PageToken provided by the API
111
108
  # @param [Integer] page_number Page Number, this value is simply for client state
112
109
  # @param [Integer] page_size Number of records to return, defaults to 50
113
-
114
110
  # @return [Page] Page of TaskQueueInstance
115
111
  def page(friendly_name: nil, evaluate_worker_attributes: nil, page_token: nil, page_number: nil, page_size: nil)
116
112
  params = {
@@ -136,7 +132,6 @@ module Twilio
136
132
  # @param [String] assignment_activity_sid The assignment_activity_sid
137
133
  # @param [String] target_workers The target_workers
138
134
  # @param [String] max_reserved_workers The max_reserved_workers
139
-
140
135
  # @return [TaskQueueInstance] Newly created TaskQueueInstance
141
136
  def create(friendly_name: nil, reservation_activity_sid: nil, assignment_activity_sid: nil, target_workers: nil, max_reserved_workers: nil)
142
137
  data = {
@@ -156,7 +151,7 @@ module Twilio
156
151
  return TaskQueueInstance.new(
157
152
  @version,
158
153
  payload,
159
- workspace_sid: @solution['workspace_sid'],
154
+ workspace_sid: @solution[:workspace_sid],
160
155
  )
161
156
  end
162
157
 
@@ -184,7 +179,6 @@ module Twilio
184
179
  # @param [Response] response Response from the API
185
180
  # @param [Hash] solution Path solution for the resource
186
181
  # @param [String] workspace_sid The workspace_sid
187
-
188
182
  # @return [TaskQueuePage] TaskQueuePage
189
183
  def initialize(version, response, solution)
190
184
  super(version, response)
@@ -196,13 +190,12 @@ module Twilio
196
190
  ##
197
191
  # Build an instance of TaskQueueInstance
198
192
  # @param [Hash] payload Payload response from the API
199
-
200
193
  # @return [TaskQueueInstance] TaskQueueInstance
201
194
  def get_instance(payload)
202
195
  return TaskQueueInstance.new(
203
196
  @version,
204
197
  payload,
205
- workspace_sid: @solution['workspace_sid'],
198
+ workspace_sid: @solution[:workspace_sid],
206
199
  )
207
200
  end
208
201
 
@@ -219,7 +212,6 @@ module Twilio
219
212
  # @param [Version] version Version that contains the resource
220
213
  # @param [String] workspace_sid The workspace_sid
221
214
  # @param [String] sid The sid
222
-
223
215
  # @return [TaskQueueContext] TaskQueueContext
224
216
  def initialize(version, workspace_sid, sid)
225
217
  super(version)
@@ -250,8 +242,8 @@ module Twilio
250
242
  return TaskQueueInstance.new(
251
243
  @version,
252
244
  payload,
253
- workspace_sid: @solution['workspace_sid'],
254
- sid: @solution['sid'],
245
+ workspace_sid: @solution[:workspace_sid],
246
+ sid: @solution[:sid],
255
247
  )
256
248
  end
257
249
 
@@ -262,7 +254,6 @@ module Twilio
262
254
  # @param [String] reservation_activity_sid The reservation_activity_sid
263
255
  # @param [String] assignment_activity_sid The assignment_activity_sid
264
256
  # @param [String] max_reserved_workers The max_reserved_workers
265
-
266
257
  # @return [TaskQueueInstance] Updated TaskQueueInstance
267
258
  def update(friendly_name: nil, target_workers: nil, reservation_activity_sid: nil, assignment_activity_sid: nil, max_reserved_workers: nil)
268
259
  data = {
@@ -282,8 +273,8 @@ module Twilio
282
273
  return TaskQueueInstance.new(
283
274
  @version,
284
275
  payload,
285
- workspace_sid: @solution['workspace_sid'],
286
- sid: @solution['sid'],
276
+ workspace_sid: @solution[:workspace_sid],
277
+ sid: @solution[:sid],
287
278
  )
288
279
  end
289
280
 
@@ -320,7 +311,6 @@ module Twilio
320
311
  # @param [Hash] payload payload that contains response from Twilio
321
312
  # @param [String] workspace_sid The workspace_sid
322
313
  # @param [String] sid The sid
323
-
324
314
  # @return [TaskQueueInstance] TaskQueueInstance
325
315
  def initialize(version, payload, workspace_sid: nil, sid: nil)
326
316
  super(version)
@@ -354,7 +344,6 @@ module Twilio
354
344
  # Generate an instance context for the instance, the context is capable of
355
345
  # performing various actions. All instance actions are proxied to the context
356
346
  # @param [Version] version Version that contains the resource
357
-
358
347
  # @return [TaskQueueContext] TaskQueueContext for this TaskQueueInstance
359
348
  def context
360
349
  unless @instance_context
@@ -423,7 +412,7 @@ module Twilio
423
412
  # Fetch a TaskQueueInstance
424
413
  # @return [TaskQueueInstance] Fetched TaskQueueInstance
425
414
  def fetch
426
- @context.fetch()
415
+ context.fetch
427
416
  end
428
417
 
429
418
  ##
@@ -433,10 +422,10 @@ module Twilio
433
422
  # @param [String] reservation_activity_sid The reservation_activity_sid
434
423
  # @param [String] assignment_activity_sid The assignment_activity_sid
435
424
  # @param [String] max_reserved_workers The max_reserved_workers
436
-
437
425
  # @return [TaskQueueInstance] Updated TaskQueueInstance
438
426
  def update(friendly_name: nil, target_workers: nil, reservation_activity_sid: nil, assignment_activity_sid: nil, max_reserved_workers: nil)
439
- @context.update(
427
+ context.update(
428
+ friendly_name: friendly_name,
440
429
  target_workers: target_workers,
441
430
  reservation_activity_sid: reservation_activity_sid,
442
431
  assignment_activity_sid: assignment_activity_sid,
@@ -448,21 +437,21 @@ module Twilio
448
437
  # Deletes the TaskQueueInstance
449
438
  # @return [Boolean] true if delete succeeds, true otherwise
450
439
  def delete
451
- @context.delete()
440
+ context.delete
452
441
  end
453
442
 
454
443
  ##
455
444
  # Access the statistics
456
445
  # @return [statistics] statistics
457
446
  def statistics
458
- @context.statistics
447
+ context.statistics
459
448
  end
460
449
 
461
450
  ##
462
451
  # Provide a user friendly representation
463
452
  def to_s
464
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
465
- "<Twilio.Taskrouter.V1.TaskQueueInstance #{context}>"
453
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
454
+ "<Twilio.Taskrouter.V1.TaskQueueInstance #{values}>"
466
455
  end
467
456
  end
468
457
  end
@@ -16,7 +16,6 @@ module Twilio
16
16
  # @param [Version] version Version that contains the resource
17
17
  # @param [String] workspace_sid The workspace_sid
18
18
  # @param [String] worker_sid The worker_sid
19
-
20
19
  # @return [WorkerStatisticsList] WorkerStatisticsList
21
20
  def initialize(version, workspace_sid: nil, worker_sid: nil)
22
21
  super(version)
@@ -43,7 +42,6 @@ module Twilio
43
42
  # @param [Hash] solution Path solution for the resource
44
43
  # @param [String] workspace_sid The workspace_sid
45
44
  # @param [String] worker_sid The worker_sid
46
-
47
45
  # @return [WorkerStatisticsPage] WorkerStatisticsPage
48
46
  def initialize(version, response, solution)
49
47
  super(version, response)
@@ -55,14 +53,13 @@ module Twilio
55
53
  ##
56
54
  # Build an instance of WorkerStatisticsInstance
57
55
  # @param [Hash] payload Payload response from the API
58
-
59
56
  # @return [WorkerStatisticsInstance] WorkerStatisticsInstance
60
57
  def get_instance(payload)
61
58
  return WorkerStatisticsInstance.new(
62
59
  @version,
63
60
  payload,
64
- workspace_sid: @solution['workspace_sid'],
65
- worker_sid: @solution['worker_sid'],
61
+ workspace_sid: @solution[:workspace_sid],
62
+ worker_sid: @solution[:worker_sid],
66
63
  )
67
64
  end
68
65
 
@@ -79,7 +76,6 @@ module Twilio
79
76
  # @param [Version] version Version that contains the resource
80
77
  # @param [String] workspace_sid The workspace_sid
81
78
  # @param [String] worker_sid The worker_sid
82
-
83
79
  # @return [WorkerStatisticsContext] WorkerStatisticsContext
84
80
  def initialize(version, workspace_sid, worker_sid)
85
81
  super(version)
@@ -97,7 +93,6 @@ module Twilio
97
93
  # @param [String] minutes The minutes
98
94
  # @param [Time] start_date The start_date
99
95
  # @param [Time] end_date The end_date
100
-
101
96
  # @return [WorkerStatisticsInstance] Fetched WorkerStatisticsInstance
102
97
  def fetch(minutes: nil, start_date: nil, end_date: nil)
103
98
  params = {
@@ -115,8 +110,8 @@ module Twilio
115
110
  return WorkerStatisticsInstance.new(
116
111
  @version,
117
112
  payload,
118
- workspace_sid: @solution['workspace_sid'],
119
- worker_sid: @solution['worker_sid'],
113
+ workspace_sid: @solution[:workspace_sid],
114
+ worker_sid: @solution[:worker_sid],
120
115
  )
121
116
  end
122
117
 
@@ -135,7 +130,6 @@ module Twilio
135
130
  # @param [Hash] payload payload that contains response from Twilio
136
131
  # @param [String] workspace_sid The workspace_sid
137
132
  # @param [String] worker_sid The worker_sid
138
-
139
133
  # @return [WorkerStatisticsInstance] WorkerStatisticsInstance
140
134
  def initialize(version, payload, workspace_sid: nil, worker_sid: nil)
141
135
  super(version)
@@ -160,7 +154,6 @@ module Twilio
160
154
  # Generate an instance context for the instance, the context is capable of
161
155
  # performing various actions. All instance actions are proxied to the context
162
156
  # @param [Version] version Version that contains the resource
163
-
164
157
  # @return [WorkerStatisticsContext] WorkerStatisticsContext for this WorkerStatisticsInstance
165
158
  def context
166
159
  unless @instance_context
@@ -194,10 +187,10 @@ module Twilio
194
187
  # @param [String] minutes The minutes
195
188
  # @param [Time] start_date The start_date
196
189
  # @param [Time] end_date The end_date
197
-
198
190
  # @return [WorkerStatisticsInstance] Fetched WorkerStatisticsInstance
199
191
  def fetch(minutes: nil, start_date: nil, end_date: nil)
200
- @context.fetch(
192
+ context.fetch(
193
+ minutes: minutes,
201
194
  start_date: start_date,
202
195
  end_date: end_date,
203
196
  )
@@ -206,8 +199,8 @@ module Twilio
206
199
  ##
207
200
  # Provide a user friendly representation
208
201
  def to_s
209
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
210
- "<Twilio.Taskrouter.V1.WorkerStatisticsInstance #{context}>"
202
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
203
+ "<Twilio.Taskrouter.V1.WorkerStatisticsInstance #{values}>"
211
204
  end
212
205
  end
213
206
  end
@@ -15,7 +15,6 @@ module Twilio
15
15
  # Initialize the WorkersStatisticsList
16
16
  # @param [Version] version Version that contains the resource
17
17
  # @param [String] workspace_sid The workspace_sid
18
-
19
18
  # @return [WorkersStatisticsList] WorkersStatisticsList
20
19
  def initialize(version, workspace_sid: nil)
21
20
  super(version)
@@ -40,7 +39,6 @@ module Twilio
40
39
  # @param [Response] response Response from the API
41
40
  # @param [Hash] solution Path solution for the resource
42
41
  # @param [String] workspace_sid The workspace_sid
43
-
44
42
  # @return [WorkersStatisticsPage] WorkersStatisticsPage
45
43
  def initialize(version, response, solution)
46
44
  super(version, response)
@@ -52,13 +50,12 @@ module Twilio
52
50
  ##
53
51
  # Build an instance of WorkersStatisticsInstance
54
52
  # @param [Hash] payload Payload response from the API
55
-
56
53
  # @return [WorkersStatisticsInstance] WorkersStatisticsInstance
57
54
  def get_instance(payload)
58
55
  return WorkersStatisticsInstance.new(
59
56
  @version,
60
57
  payload,
61
- workspace_sid: @solution['workspace_sid'],
58
+ workspace_sid: @solution[:workspace_sid],
62
59
  )
63
60
  end
64
61
 
@@ -74,7 +71,6 @@ module Twilio
74
71
  # Initialize the WorkersStatisticsContext
75
72
  # @param [Version] version Version that contains the resource
76
73
  # @param [String] workspace_sid The workspace_sid
77
-
78
74
  # @return [WorkersStatisticsContext] WorkersStatisticsContext
79
75
  def initialize(version, workspace_sid)
80
76
  super(version)
@@ -94,7 +90,6 @@ module Twilio
94
90
  # @param [String] task_queue_sid The task_queue_sid
95
91
  # @param [String] task_queue_name The task_queue_name
96
92
  # @param [String] friendly_name The friendly_name
97
-
98
93
  # @return [WorkersStatisticsInstance] Fetched WorkersStatisticsInstance
99
94
  def fetch(minutes: nil, start_date: nil, end_date: nil, task_queue_sid: nil, task_queue_name: nil, friendly_name: nil)
100
95
  params = {
@@ -115,7 +110,7 @@ module Twilio
115
110
  return WorkersStatisticsInstance.new(
116
111
  @version,
117
112
  payload,
118
- workspace_sid: @solution['workspace_sid'],
113
+ workspace_sid: @solution[:workspace_sid],
119
114
  )
120
115
  end
121
116
 
@@ -133,7 +128,6 @@ module Twilio
133
128
  # @param [Version] version Version that contains the resource
134
129
  # @param [Hash] payload payload that contains response from Twilio
135
130
  # @param [String] workspace_sid The workspace_sid
136
-
137
131
  # @return [WorkersStatisticsInstance] WorkersStatisticsInstance
138
132
  def initialize(version, payload, workspace_sid: nil)
139
133
  super(version)
@@ -157,7 +151,6 @@ module Twilio
157
151
  # Generate an instance context for the instance, the context is capable of
158
152
  # performing various actions. All instance actions are proxied to the context
159
153
  # @param [Version] version Version that contains the resource
160
-
161
154
  # @return [WorkersStatisticsContext] WorkersStatisticsContext for this WorkersStatisticsInstance
162
155
  def context
163
156
  unless @instance_context
@@ -193,10 +186,10 @@ module Twilio
193
186
  # @param [String] task_queue_sid The task_queue_sid
194
187
  # @param [String] task_queue_name The task_queue_name
195
188
  # @param [String] friendly_name The friendly_name
196
-
197
189
  # @return [WorkersStatisticsInstance] Fetched WorkersStatisticsInstance
198
190
  def fetch(minutes: nil, start_date: nil, end_date: nil, task_queue_sid: nil, task_queue_name: nil, friendly_name: nil)
199
- @context.fetch(
191
+ context.fetch(
192
+ minutes: minutes,
200
193
  start_date: start_date,
201
194
  end_date: end_date,
202
195
  task_queue_sid: task_queue_sid,
@@ -208,8 +201,8 @@ module Twilio
208
201
  ##
209
202
  # Provide a user friendly representation
210
203
  def to_s
211
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
212
- "<Twilio.Taskrouter.V1.WorkersStatisticsInstance #{context}>"
204
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
205
+ "<Twilio.Taskrouter.V1.WorkersStatisticsInstance #{values}>"
213
206
  end
214
207
  end
215
208
  end
@@ -14,7 +14,6 @@ module Twilio
14
14
  # Initialize the WorkerList
15
15
  # @param [Version] version Version that contains the resource
16
16
  # @param [String] workspace_sid The workspace_sid
17
-
18
17
  # @return [WorkerList] WorkerList
19
18
  def initialize(version, workspace_sid: nil)
20
19
  super(version)
@@ -46,7 +45,6 @@ module Twilio
46
45
  # the default value of 50 records. If no page_size is defined
47
46
  # but a limit is defined, stream() will attempt to read the
48
47
  # limit with the most efficient page size, i.e. min(limit, 1000)
49
-
50
48
  # @return [Array] Array of up to limit results
51
49
  def list(activity_name: nil, activity_sid: nil, available: nil, friendly_name: nil, target_workers_expression: nil, task_queue_name: nil, task_queue_sid: nil, limit: nil, page_size: nil)
52
50
  self.stream(
@@ -79,7 +77,6 @@ module Twilio
79
77
  # the default value of 50 records. If no page_size is defined
80
78
  # but a limit is defined, stream() will attempt to read the
81
79
  # limit with the most efficient page size, i.e. min(limit, 1000)
82
-
83
80
  # @return [Enumerable] Enumerable that will yield up to limit results
84
81
  def stream(activity_name: nil, activity_sid: nil, available: nil, friendly_name: nil, target_workers_expression: nil, task_queue_name: nil, task_queue_sid: nil, limit: nil, page_size: nil)
85
82
  limits = @version.read_limits(limit, page_size)
@@ -140,7 +137,6 @@ module Twilio
140
137
  # @param [String] page_token PageToken provided by the API
141
138
  # @param [Integer] page_number Page Number, this value is simply for client state
142
139
  # @param [Integer] page_size Number of records to return, defaults to 50
143
-
144
140
  # @return [Page] Page of WorkerInstance
145
141
  def page(activity_name: nil, activity_sid: nil, available: nil, friendly_name: nil, target_workers_expression: nil, task_queue_name: nil, task_queue_sid: nil, page_token: nil, page_number: nil, page_size: nil)
146
142
  params = {
@@ -169,7 +165,6 @@ module Twilio
169
165
  # @param [String] friendly_name The friendly_name
170
166
  # @param [String] activity_sid The activity_sid
171
167
  # @param [String] attributes The attributes
172
-
173
168
  # @return [WorkerInstance] Newly created WorkerInstance
174
169
  def create(friendly_name: nil, activity_sid: nil, attributes: nil)
175
170
  data = {
@@ -187,7 +182,7 @@ module Twilio
187
182
  return WorkerInstance.new(
188
183
  @version,
189
184
  payload,
190
- workspace_sid: @solution['workspace_sid'],
185
+ workspace_sid: @solution[:workspace_sid],
191
186
  )
192
187
  end
193
188
 
@@ -220,7 +215,6 @@ module Twilio
220
215
  # @param [Response] response Response from the API
221
216
  # @param [Hash] solution Path solution for the resource
222
217
  # @param [String] workspace_sid The workspace_sid
223
-
224
218
  # @return [WorkerPage] WorkerPage
225
219
  def initialize(version, response, solution)
226
220
  super(version, response)
@@ -232,13 +226,12 @@ module Twilio
232
226
  ##
233
227
  # Build an instance of WorkerInstance
234
228
  # @param [Hash] payload Payload response from the API
235
-
236
229
  # @return [WorkerInstance] WorkerInstance
237
230
  def get_instance(payload)
238
231
  return WorkerInstance.new(
239
232
  @version,
240
233
  payload,
241
- workspace_sid: @solution['workspace_sid'],
234
+ workspace_sid: @solution[:workspace_sid],
242
235
  )
243
236
  end
244
237
 
@@ -255,7 +248,6 @@ module Twilio
255
248
  # @param [Version] version Version that contains the resource
256
249
  # @param [String] workspace_sid The workspace_sid
257
250
  # @param [String] sid The sid
258
-
259
251
  # @return [WorkerContext] WorkerContext
260
252
  def initialize(version, workspace_sid, sid)
261
253
  super(version)
@@ -286,8 +278,8 @@ module Twilio
286
278
  return WorkerInstance.new(
287
279
  @version,
288
280
  payload,
289
- workspace_sid: @solution['workspace_sid'],
290
- sid: @solution['sid'],
281
+ workspace_sid: @solution[:workspace_sid],
282
+ sid: @solution[:sid],
291
283
  )
292
284
  end
293
285
 
@@ -296,7 +288,6 @@ module Twilio
296
288
  # @param [String] activity_sid The activity_sid
297
289
  # @param [String] attributes The attributes
298
290
  # @param [String] friendly_name The friendly_name
299
-
300
291
  # @return [WorkerInstance] Updated WorkerInstance
301
292
  def update(activity_sid: nil, attributes: nil, friendly_name: nil)
302
293
  data = {
@@ -314,8 +305,8 @@ module Twilio
314
305
  return WorkerInstance.new(
315
306
  @version,
316
307
  payload,
317
- workspace_sid: @solution['workspace_sid'],
318
- sid: @solution['sid'],
308
+ workspace_sid: @solution[:workspace_sid],
309
+ sid: @solution[:sid],
319
310
  )
320
311
  end
321
312
 
@@ -352,7 +343,6 @@ module Twilio
352
343
  # @param [Hash] payload payload that contains response from Twilio
353
344
  # @param [String] workspace_sid The workspace_sid
354
345
  # @param [String] sid The sid
355
-
356
346
  # @return [WorkerInstance] WorkerInstance
357
347
  def initialize(version, payload, workspace_sid: nil, sid: nil)
358
348
  super(version)
@@ -384,7 +374,6 @@ module Twilio
384
374
  # Generate an instance context for the instance, the context is capable of
385
375
  # performing various actions. All instance actions are proxied to the context
386
376
  # @param [Version] version Version that contains the resource
387
-
388
377
  # @return [WorkerContext] WorkerContext for this WorkerInstance
389
378
  def context
390
379
  unless @instance_context
@@ -445,7 +434,7 @@ module Twilio
445
434
  # Fetch a WorkerInstance
446
435
  # @return [WorkerInstance] Fetched WorkerInstance
447
436
  def fetch
448
- @context.fetch()
437
+ context.fetch
449
438
  end
450
439
 
451
440
  ##
@@ -453,10 +442,10 @@ module Twilio
453
442
  # @param [String] activity_sid The activity_sid
454
443
  # @param [String] attributes The attributes
455
444
  # @param [String] friendly_name The friendly_name
456
-
457
445
  # @return [WorkerInstance] Updated WorkerInstance
458
446
  def update(activity_sid: nil, attributes: nil, friendly_name: nil)
459
- @context.update(
447
+ context.update(
448
+ activity_sid: activity_sid,
460
449
  attributes: attributes,
461
450
  friendly_name: friendly_name,
462
451
  )
@@ -466,21 +455,21 @@ module Twilio
466
455
  # Deletes the WorkerInstance
467
456
  # @return [Boolean] true if delete succeeds, true otherwise
468
457
  def delete
469
- @context.delete()
458
+ context.delete
470
459
  end
471
460
 
472
461
  ##
473
462
  # Access the statistics
474
463
  # @return [statistics] statistics
475
464
  def statistics
476
- @context.statistics
465
+ context.statistics
477
466
  end
478
467
 
479
468
  ##
480
469
  # Provide a user friendly representation
481
470
  def to_s
482
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
483
- "<Twilio.Taskrouter.V1.WorkerInstance #{context}>"
471
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
472
+ "<Twilio.Taskrouter.V1.WorkerInstance #{values}>"
484
473
  end
485
474
  end
486
475
  end