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
@@ -69,10 +69,22 @@ module Twilio
69
69
  self.account.incoming_phone_numbers(sid)
70
70
  end
71
71
 
72
+ def keys(sid=:unset)
73
+ self.account.keys(sid)
74
+ end
75
+
72
76
  def messages(sid=:unset)
73
77
  self.account.messages(sid)
74
78
  end
75
79
 
80
+ def new_keys
81
+ self.account.new_keys()
82
+ end
83
+
84
+ def new_signing_keys
85
+ self.account.new_signing_keys()
86
+ end
87
+
76
88
  def notifications(sid=:unset)
77
89
  self.account.notifications(sid)
78
90
  end
@@ -93,6 +105,10 @@ module Twilio
93
105
  self.account.sandbox()
94
106
  end
95
107
 
108
+ def signing_keys(sid=:unset)
109
+ self.account.signing_keys(sid)
110
+ end
111
+
96
112
  def sip
97
113
  self.account.sip()
98
114
  end
@@ -120,7 +136,7 @@ module Twilio
120
136
  ##
121
137
  # Provide a user friendly representation
122
138
  def to_s
123
- #<Twilio::REST::Api::V2010>
139
+ '<Twilio::REST::Api::V2010>'
124
140
  end
125
141
  end
126
142
  end
@@ -68,10 +68,22 @@ module Twilio
68
68
  self.account.incoming_phone_numbers(sid)
69
69
  end
70
70
 
71
+ def keys(sid=:unset)
72
+ self.account.keys(sid)
73
+ end
74
+
71
75
  def messages(sid=:unset)
72
76
  self.account.messages(sid)
73
77
  end
74
78
 
79
+ def new_keys
80
+ self.account.new_keys()
81
+ end
82
+
83
+ def new_signing_keys
84
+ self.account.new_signing_keys()
85
+ end
86
+
75
87
  def notifications(sid=:unset)
76
88
  self.account.notifications(sid)
77
89
  end
@@ -92,6 +104,10 @@ module Twilio
92
104
  self.account.sandbox()
93
105
  end
94
106
 
107
+ def signing_keys(sid=:unset)
108
+ self.account.signing_keys(sid)
109
+ end
110
+
95
111
  def sip
96
112
  self.account.sip()
97
113
  end
@@ -157,10 +157,22 @@ module Twilio
157
157
  return self.account.incoming_phone_numbers
158
158
  end
159
159
 
160
+ def keys
161
+ return self.account.keys
162
+ end
163
+
160
164
  def messages
161
165
  return self.account.messages
162
166
  end
163
167
 
168
+ def new_keys
169
+ return self.account.new_keys
170
+ end
171
+
172
+ def new_signing_keys
173
+ return self.account.new_signing_keys
174
+ end
175
+
164
176
  def outgoing_caller_ids
165
177
  return self.account.outgoing_caller_ids
166
178
  end
@@ -177,6 +189,10 @@ module Twilio
177
189
  return self.account.sandbox
178
190
  end
179
191
 
192
+ def signing_keys
193
+ return self.account.signing_keys
194
+ end
195
+
180
196
  def sip
181
197
  return self.account.sip
182
198
  end
@@ -12,7 +12,6 @@ module Twilio
12
12
  ##
13
13
  # Initialize the CredentialList
14
14
  # @param [Version] version Version that contains the resource
15
-
16
15
  # @return [CredentialList] CredentialList
17
16
  def initialize(version)
18
17
  super(version)
@@ -32,7 +31,6 @@ module Twilio
32
31
  # the default value of 50 records. If no page_size is defined
33
32
  # but a limit is defined, stream() will attempt to read the
34
33
  # limit with the most efficient page size, i.e. min(limit, 1000)
35
-
36
34
  # @return [Array] Array of up to limit results
37
35
  def list(limit: nil, page_size: nil)
38
36
  self.stream(
@@ -51,7 +49,6 @@ module Twilio
51
49
  # the default value of 50 records. If no page_size is defined
52
50
  # but a limit is defined, stream() will attempt to read the
53
51
  # limit with the most efficient page size, i.e. min(limit, 1000)
54
-
55
52
  # @return [Enumerable] Enumerable that will yield up to limit results
56
53
  def stream(limit: nil, page_size: nil)
57
54
  limits = @version.read_limits(limit, page_size)
@@ -91,7 +88,6 @@ module Twilio
91
88
  # @param [String] page_token PageToken provided by the API
92
89
  # @param [Integer] page_number Page Number, this value is simply for client state
93
90
  # @param [Integer] page_size Number of records to return, defaults to 50
94
-
95
91
  # @return [Page] Page of CredentialInstance
96
92
  def page(page_token: nil, page_number: nil, page_size: nil)
97
93
  params = {
@@ -110,18 +106,17 @@ module Twilio
110
106
  ##
111
107
  # Retrieve a single page of CredentialInstance records from the API.
112
108
  # Request is executed immediately.
113
- # @param [String] friendly_name The friendly_name
114
109
  # @param [credential.PushService] type The type
110
+ # @param [String] friendly_name The friendly_name
115
111
  # @param [String] certificate The certificate
116
112
  # @param [String] private_key The private_key
117
113
  # @param [Boolean] sandbox The sandbox
118
114
  # @param [String] api_key The api_key
119
-
120
115
  # @return [CredentialInstance] Newly created CredentialInstance
121
- def create(friendly_name: nil, type: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
116
+ def create(type: nil, friendly_name: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
122
117
  data = {
123
- 'FriendlyName' => friendly_name,
124
118
  'Type' => type,
119
+ 'FriendlyName' => friendly_name,
125
120
  'Certificate' => certificate,
126
121
  'PrivateKey' => private_key,
127
122
  'Sandbox' => sandbox,
@@ -153,7 +148,6 @@ module Twilio
153
148
  # @param [Version] version Version that contains the resource
154
149
  # @param [Response] response Response from the API
155
150
  # @param [Hash] solution Path solution for the resource
156
-
157
151
  # @return [CredentialPage] CredentialPage
158
152
  def initialize(version, response, solution)
159
153
  super(version, response)
@@ -165,7 +159,6 @@ module Twilio
165
159
  ##
166
160
  # Build an instance of CredentialInstance
167
161
  # @param [Hash] payload Payload response from the API
168
-
169
162
  # @return [CredentialInstance] CredentialInstance
170
163
  def get_instance(payload)
171
164
  return CredentialInstance.new(
@@ -186,7 +179,6 @@ module Twilio
186
179
  # Initialize the CredentialContext
187
180
  # @param [Version] version Version that contains the resource
188
181
  # @param [String] sid The sid
189
-
190
182
  # @return [CredentialContext] CredentialContext
191
183
  def initialize(version, sid)
192
184
  super(version)
@@ -213,24 +205,21 @@ module Twilio
213
205
  return CredentialInstance.new(
214
206
  @version,
215
207
  payload,
216
- sid: @solution['sid'],
208
+ sid: @solution[:sid],
217
209
  )
218
210
  end
219
211
 
220
212
  ##
221
213
  # Update the CredentialInstance
222
214
  # @param [String] friendly_name The friendly_name
223
- # @param [credential.PushService] type The type
224
215
  # @param [String] certificate The certificate
225
216
  # @param [String] private_key The private_key
226
217
  # @param [Boolean] sandbox The sandbox
227
218
  # @param [String] api_key The api_key
228
-
229
219
  # @return [CredentialInstance] Updated CredentialInstance
230
- def update(friendly_name: nil, type: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
220
+ def update(friendly_name: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
231
221
  data = {
232
222
  'FriendlyName' => friendly_name,
233
- 'Type' => type,
234
223
  'Certificate' => certificate,
235
224
  'PrivateKey' => private_key,
236
225
  'Sandbox' => sandbox,
@@ -246,7 +235,7 @@ module Twilio
246
235
  return CredentialInstance.new(
247
236
  @version,
248
237
  payload,
249
- sid: @solution['sid'],
238
+ sid: @solution[:sid],
250
239
  )
251
240
  end
252
241
 
@@ -271,7 +260,6 @@ module Twilio
271
260
  # @param [Version] version Version that contains the resource
272
261
  # @param [Hash] payload payload that contains response from Twilio
273
262
  # @param [String] sid The sid
274
-
275
263
  # @return [CredentialInstance] CredentialInstance
276
264
  def initialize(version, payload, sid: nil)
277
265
  super(version)
@@ -299,7 +287,6 @@ module Twilio
299
287
  # Generate an instance context for the instance, the context is capable of
300
288
  # performing various actions. All instance actions are proxied to the context
301
289
  # @param [Version] version Version that contains the resource
302
-
303
290
  # @return [CredentialContext] CredentialContext for this CredentialInstance
304
291
  def context
305
292
  unless @instance_context
@@ -347,22 +334,20 @@ module Twilio
347
334
  # Fetch a CredentialInstance
348
335
  # @return [CredentialInstance] Fetched CredentialInstance
349
336
  def fetch
350
- @context.fetch()
337
+ context.fetch
351
338
  end
352
339
 
353
340
  ##
354
341
  # Update the CredentialInstance
355
342
  # @param [String] friendly_name The friendly_name
356
- # @param [credential.PushService] type The type
357
343
  # @param [String] certificate The certificate
358
344
  # @param [String] private_key The private_key
359
345
  # @param [Boolean] sandbox The sandbox
360
346
  # @param [String] api_key The api_key
361
-
362
347
  # @return [CredentialInstance] Updated CredentialInstance
363
- def update(friendly_name: nil, type: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
364
- @context.update(
365
- type: type,
348
+ def update(friendly_name: nil, certificate: nil, private_key: nil, sandbox: nil, api_key: nil)
349
+ context.update(
350
+ friendly_name: friendly_name,
366
351
  certificate: certificate,
367
352
  private_key: private_key,
368
353
  sandbox: sandbox,
@@ -374,14 +359,14 @@ module Twilio
374
359
  # Deletes the CredentialInstance
375
360
  # @return [Boolean] true if delete succeeds, true otherwise
376
361
  def delete
377
- @context.delete()
362
+ context.delete
378
363
  end
379
364
 
380
365
  ##
381
366
  # Provide a user friendly representation
382
367
  def to_s
383
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
384
- "<Twilio.IpMessaging.V1.CredentialInstance #{context}>"
368
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
369
+ "<Twilio.IpMessaging.V1.CredentialInstance #{values}>"
385
370
  end
386
371
  end
387
372
  end
@@ -16,7 +16,6 @@ module Twilio
16
16
  # @param [Version] version Version that contains the resource
17
17
  # @param [String] service_sid The service_sid
18
18
  # @param [String] channel_sid The channel_sid
19
-
20
19
  # @return [MemberList] MemberList
21
20
  def initialize(version, service_sid: nil, channel_sid: nil)
22
21
  super(version)
@@ -34,7 +33,6 @@ module Twilio
34
33
  # Request is executed immediately.
35
34
  # @param [String] identity The identity
36
35
  # @param [String] role_sid The role_sid
37
-
38
36
  # @return [MemberInstance] Newly created MemberInstance
39
37
  def create(identity: nil, role_sid: nil)
40
38
  data = {
@@ -51,8 +49,8 @@ module Twilio
51
49
  return MemberInstance.new(
52
50
  @version,
53
51
  payload,
54
- service_sid: @solution['service_sid'],
55
- channel_sid: @solution['channel_sid'],
52
+ service_sid: @solution[:service_sid],
53
+ channel_sid: @solution[:channel_sid],
56
54
  )
57
55
  end
58
56
 
@@ -66,7 +64,6 @@ module Twilio
66
64
  # the default value of 50 records. If no page_size is defined
67
65
  # but a limit is defined, stream() will attempt to read the
68
66
  # limit with the most efficient page size, i.e. min(limit, 1000)
69
-
70
67
  # @return [Array] Array of up to limit results
71
68
  def list(limit: nil, page_size: nil)
72
69
  self.stream(
@@ -85,7 +82,6 @@ module Twilio
85
82
  # the default value of 50 records. If no page_size is defined
86
83
  # but a limit is defined, stream() will attempt to read the
87
84
  # limit with the most efficient page size, i.e. min(limit, 1000)
88
-
89
85
  # @return [Enumerable] Enumerable that will yield up to limit results
90
86
  def stream(limit: nil, page_size: nil)
91
87
  limits = @version.read_limits(limit, page_size)
@@ -125,7 +121,6 @@ module Twilio
125
121
  # @param [String] page_token PageToken provided by the API
126
122
  # @param [Integer] page_number Page Number, this value is simply for client state
127
123
  # @param [Integer] page_size Number of records to return, defaults to 50
128
-
129
124
  # @return [Page] Page of MemberInstance
130
125
  def page(page_token: nil, page_number: nil, page_size: nil)
131
126
  params = {
@@ -156,7 +151,6 @@ module Twilio
156
151
  # @param [Hash] solution Path solution for the resource
157
152
  # @param [String] service_sid The service_sid
158
153
  # @param [String] channel_sid The channel_sid
159
-
160
154
  # @return [MemberPage] MemberPage
161
155
  def initialize(version, response, solution)
162
156
  super(version, response)
@@ -168,14 +162,13 @@ module Twilio
168
162
  ##
169
163
  # Build an instance of MemberInstance
170
164
  # @param [Hash] payload Payload response from the API
171
-
172
165
  # @return [MemberInstance] MemberInstance
173
166
  def get_instance(payload)
174
167
  return MemberInstance.new(
175
168
  @version,
176
169
  payload,
177
- service_sid: @solution['service_sid'],
178
- channel_sid: @solution['channel_sid'],
170
+ service_sid: @solution[:service_sid],
171
+ channel_sid: @solution[:channel_sid],
179
172
  )
180
173
  end
181
174
 
@@ -193,7 +186,6 @@ module Twilio
193
186
  # @param [String] service_sid The service_sid
194
187
  # @param [String] channel_sid The channel_sid
195
188
  # @param [String] sid The sid
196
-
197
189
  # @return [MemberContext] MemberContext
198
190
  def initialize(version, service_sid, channel_sid, sid)
199
191
  super(version)
@@ -222,9 +214,9 @@ module Twilio
222
214
  return MemberInstance.new(
223
215
  @version,
224
216
  payload,
225
- service_sid: @solution['service_sid'],
226
- channel_sid: @solution['channel_sid'],
227
- sid: @solution['sid'],
217
+ service_sid: @solution[:service_sid],
218
+ channel_sid: @solution[:channel_sid],
219
+ sid: @solution[:sid],
228
220
  )
229
221
  end
230
222
 
@@ -251,7 +243,6 @@ module Twilio
251
243
  # @param [String] service_sid The service_sid
252
244
  # @param [String] channel_sid The channel_sid
253
245
  # @param [String] sid The sid
254
-
255
246
  # @return [MemberInstance] MemberInstance
256
247
  def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil)
257
248
  super(version)
@@ -282,7 +273,6 @@ module Twilio
282
273
  # Generate an instance context for the instance, the context is capable of
283
274
  # performing various actions. All instance actions are proxied to the context
284
275
  # @param [Version] version Version that contains the resource
285
-
286
276
  # @return [MemberContext] MemberContext for this MemberInstance
287
277
  def context
288
278
  unless @instance_context
@@ -336,21 +326,21 @@ module Twilio
336
326
  # Fetch a MemberInstance
337
327
  # @return [MemberInstance] Fetched MemberInstance
338
328
  def fetch
339
- @context.fetch()
329
+ context.fetch
340
330
  end
341
331
 
342
332
  ##
343
333
  # Deletes the MemberInstance
344
334
  # @return [Boolean] true if delete succeeds, true otherwise
345
335
  def delete
346
- @context.delete()
336
+ context.delete
347
337
  end
348
338
 
349
339
  ##
350
340
  # Provide a user friendly representation
351
341
  def to_s
352
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
353
- "<Twilio.IpMessaging.V1.MemberInstance #{context}>"
342
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
343
+ "<Twilio.IpMessaging.V1.MemberInstance #{values}>"
354
344
  end
355
345
  end
356
346
  end
@@ -16,7 +16,6 @@ module Twilio
16
16
  # @param [Version] version Version that contains the resource
17
17
  # @param [String] service_sid The service_sid
18
18
  # @param [String] channel_sid The sid
19
-
20
19
  # @return [MessageList] MessageList
21
20
  def initialize(version, service_sid: nil, channel_sid: nil)
22
21
  super(version)
@@ -34,7 +33,6 @@ module Twilio
34
33
  # Request is executed immediately.
35
34
  # @param [String] body The body
36
35
  # @param [String] from The from
37
-
38
36
  # @return [MessageInstance] Newly created MessageInstance
39
37
  def create(body: nil, from: nil)
40
38
  data = {
@@ -51,8 +49,8 @@ module Twilio
51
49
  return MessageInstance.new(
52
50
  @version,
53
51
  payload,
54
- service_sid: @solution['service_sid'],
55
- channel_sid: @solution['channel_sid'],
52
+ service_sid: @solution[:service_sid],
53
+ channel_sid: @solution[:channel_sid],
56
54
  )
57
55
  end
58
56
 
@@ -66,7 +64,6 @@ module Twilio
66
64
  # the default value of 50 records. If no page_size is defined
67
65
  # but a limit is defined, stream() will attempt to read the
68
66
  # limit with the most efficient page size, i.e. min(limit, 1000)
69
-
70
67
  # @return [Array] Array of up to limit results
71
68
  def list(limit: nil, page_size: nil)
72
69
  self.stream(
@@ -85,7 +82,6 @@ module Twilio
85
82
  # the default value of 50 records. If no page_size is defined
86
83
  # but a limit is defined, stream() will attempt to read the
87
84
  # limit with the most efficient page size, i.e. min(limit, 1000)
88
-
89
85
  # @return [Enumerable] Enumerable that will yield up to limit results
90
86
  def stream(limit: nil, page_size: nil)
91
87
  limits = @version.read_limits(limit, page_size)
@@ -125,7 +121,6 @@ module Twilio
125
121
  # @param [String] page_token PageToken provided by the API
126
122
  # @param [Integer] page_number Page Number, this value is simply for client state
127
123
  # @param [Integer] page_size Number of records to return, defaults to 50
128
-
129
124
  # @return [Page] Page of MessageInstance
130
125
  def page(page_token: nil, page_number: nil, page_size: nil)
131
126
  params = {
@@ -156,7 +151,6 @@ module Twilio
156
151
  # @param [Hash] solution Path solution for the resource
157
152
  # @param [String] service_sid The service_sid
158
153
  # @param [String] channel_sid The sid
159
-
160
154
  # @return [MessagePage] MessagePage
161
155
  def initialize(version, response, solution)
162
156
  super(version, response)
@@ -168,14 +162,13 @@ module Twilio
168
162
  ##
169
163
  # Build an instance of MessageInstance
170
164
  # @param [Hash] payload Payload response from the API
171
-
172
165
  # @return [MessageInstance] MessageInstance
173
166
  def get_instance(payload)
174
167
  return MessageInstance.new(
175
168
  @version,
176
169
  payload,
177
- service_sid: @solution['service_sid'],
178
- channel_sid: @solution['channel_sid'],
170
+ service_sid: @solution[:service_sid],
171
+ channel_sid: @solution[:channel_sid],
179
172
  )
180
173
  end
181
174
 
@@ -193,7 +186,6 @@ module Twilio
193
186
  # @param [String] service_sid The service_sid
194
187
  # @param [String] channel_sid The channel_sid
195
188
  # @param [String] sid The sid
196
-
197
189
  # @return [MessageContext] MessageContext
198
190
  def initialize(version, service_sid, channel_sid, sid)
199
191
  super(version)
@@ -222,9 +214,42 @@ module Twilio
222
214
  return MessageInstance.new(
223
215
  @version,
224
216
  payload,
225
- service_sid: @solution['service_sid'],
226
- channel_sid: @solution['channel_sid'],
227
- sid: @solution['sid'],
217
+ service_sid: @solution[:service_sid],
218
+ channel_sid: @solution[:channel_sid],
219
+ sid: @solution[:sid],
220
+ )
221
+ end
222
+
223
+ ##
224
+ # Deletes the MessageInstance
225
+ # @return [Boolean] true if delete succeeds, true otherwise
226
+ def delete
227
+ return @version.delete('delete', @uri)
228
+ end
229
+
230
+ ##
231
+ # Update the MessageInstance
232
+ # @param [String] body The body
233
+ # @param [Hash] attributes The attributes
234
+ # @return [MessageInstance] Updated MessageInstance
235
+ def update(body: nil, attributes: nil)
236
+ data = {
237
+ 'Body' => body,
238
+ 'Attributes' => attributes,
239
+ }
240
+
241
+ payload = @version.update(
242
+ 'POST',
243
+ @uri,
244
+ data: data,
245
+ )
246
+
247
+ return MessageInstance.new(
248
+ @version,
249
+ payload,
250
+ service_sid: @solution[:service_sid],
251
+ channel_sid: @solution[:channel_sid],
252
+ sid: @solution[:sid],
228
253
  )
229
254
  end
230
255
 
@@ -244,7 +269,6 @@ module Twilio
244
269
  # @param [String] service_sid The service_sid
245
270
  # @param [String] channel_sid The sid
246
271
  # @param [String] sid The sid
247
-
248
272
  # @return [MessageInstance] MessageInstance
249
273
  def initialize(version, payload, service_sid: nil, channel_sid: nil, sid: nil)
250
274
  super(version)
@@ -276,7 +300,6 @@ module Twilio
276
300
  # Generate an instance context for the instance, the context is capable of
277
301
  # performing various actions. All instance actions are proxied to the context
278
302
  # @param [Version] version Version that contains the resource
279
-
280
303
  # @return [MessageContext] MessageContext for this MessageInstance
281
304
  def context
282
305
  unless @instance_context
@@ -334,14 +357,33 @@ module Twilio
334
357
  # Fetch a MessageInstance
335
358
  # @return [MessageInstance] Fetched MessageInstance
336
359
  def fetch
337
- @context.fetch()
360
+ context.fetch
361
+ end
362
+
363
+ ##
364
+ # Deletes the MessageInstance
365
+ # @return [Boolean] true if delete succeeds, true otherwise
366
+ def delete
367
+ context.delete
368
+ end
369
+
370
+ ##
371
+ # Update the MessageInstance
372
+ # @param [String] body The body
373
+ # @param [Hash] attributes The attributes
374
+ # @return [MessageInstance] Updated MessageInstance
375
+ def update(body: nil, attributes: nil)
376
+ context.update(
377
+ body: body,
378
+ attributes: attributes,
379
+ )
338
380
  end
339
381
 
340
382
  ##
341
383
  # Provide a user friendly representation
342
384
  def to_s
343
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
344
- "<Twilio.IpMessaging.V1.MessageInstance #{context}>"
385
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
386
+ "<Twilio.IpMessaging.V1.MessageInstance #{values}>"
345
387
  end
346
388
  end
347
389
  end