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
@@ -16,7 +16,6 @@ module Twilio
16
16
  # @param [Version] version Version that contains the resource
17
17
  # @param [String] owner_account_sid A 34 character string that uniquely identifies
18
18
  # this resource.
19
-
20
19
  # @return [MobileList] MobileList
21
20
  def initialize(version, owner_account_sid: nil)
22
21
  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(beta: nil, friendly_name: nil, phone_number: nil, limit: nil, page_size: nil)
47
45
  self.stream(
@@ -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 [Enumerable] Enumerable that will yield up to limit results
71
68
  def stream(beta: nil, friendly_name: nil, phone_number: nil, limit: nil, page_size: nil)
72
69
  limits = @version.read_limits(limit, page_size)
@@ -115,7 +112,6 @@ module Twilio
115
112
  # @param [String] page_token PageToken provided by the API
116
113
  # @param [Integer] page_number Page Number, this value is simply for client state
117
114
  # @param [Integer] page_size Number of records to return, defaults to 50
118
-
119
115
  # @return [Page] Page of MobileInstance
120
116
  def page(beta: nil, friendly_name: nil, phone_number: nil, page_token: nil, page_number: nil, page_size: nil)
121
117
  params = {
@@ -153,7 +149,6 @@ module Twilio
153
149
  # @param [String] voice_fallback_url The voice_fallback_url
154
150
  # @param [String] voice_method The voice_method
155
151
  # @param [String] voice_url The voice_url
156
-
157
152
  # @return [MobileInstance] Newly created MobileInstance
158
153
  def create(phone_number: nil, api_version: nil, friendly_name: nil, sms_application_sid: nil, sms_fallback_method: nil, sms_fallback_url: nil, sms_method: nil, sms_url: nil, status_callback: nil, status_callback_method: nil, voice_application_sid: nil, voice_caller_id_lookup: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_url: nil)
159
154
  data = {
@@ -184,7 +179,7 @@ module Twilio
184
179
  return MobileInstance.new(
185
180
  @version,
186
181
  payload,
187
- owner_account_sid: @solution['owner_account_sid'],
182
+ owner_account_sid: @solution[:owner_account_sid],
188
183
  )
189
184
  end
190
185
 
@@ -203,7 +198,6 @@ module Twilio
203
198
  # @param [Hash] solution Path solution for the resource
204
199
  # @param [String] owner_account_sid A 34 character string that uniquely identifies
205
200
  # this resource.
206
-
207
201
  # @return [MobilePage] MobilePage
208
202
  def initialize(version, response, solution)
209
203
  super(version, response)
@@ -215,13 +209,12 @@ module Twilio
215
209
  ##
216
210
  # Build an instance of MobileInstance
217
211
  # @param [Hash] payload Payload response from the API
218
-
219
212
  # @return [MobileInstance] MobileInstance
220
213
  def get_instance(payload)
221
214
  return MobileInstance.new(
222
215
  @version,
223
216
  payload,
224
- owner_account_sid: @solution['owner_account_sid'],
217
+ owner_account_sid: @solution[:owner_account_sid],
225
218
  )
226
219
  end
227
220
 
@@ -239,7 +232,6 @@ module Twilio
239
232
  # @param [Hash] payload payload that contains response from Twilio
240
233
  # @param [String] owner_account_sid A 34 character string that uniquely identifies
241
234
  # this resource.
242
-
243
235
  # @return [MobileInstance] MobileInstance
244
236
  def initialize(version, payload, owner_account_sid: nil)
245
237
  super(version)
@@ -16,7 +16,6 @@ module Twilio
16
16
  # @param [Version] version Version that contains the resource
17
17
  # @param [String] owner_account_sid A 34 character string that uniquely identifies
18
18
  # this resource.
19
-
20
19
  # @return [TollFreeList] TollFreeList
21
20
  def initialize(version, owner_account_sid: nil)
22
21
  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(beta: nil, friendly_name: nil, phone_number: nil, limit: nil, page_size: nil)
47
45
  self.stream(
@@ -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 [Enumerable] Enumerable that will yield up to limit results
71
68
  def stream(beta: nil, friendly_name: nil, phone_number: nil, limit: nil, page_size: nil)
72
69
  limits = @version.read_limits(limit, page_size)
@@ -115,7 +112,6 @@ module Twilio
115
112
  # @param [String] page_token PageToken provided by the API
116
113
  # @param [Integer] page_number Page Number, this value is simply for client state
117
114
  # @param [Integer] page_size Number of records to return, defaults to 50
118
-
119
115
  # @return [Page] Page of TollFreeInstance
120
116
  def page(beta: nil, friendly_name: nil, phone_number: nil, page_token: nil, page_number: nil, page_size: nil)
121
117
  params = {
@@ -153,7 +149,6 @@ module Twilio
153
149
  # @param [String] voice_fallback_url The voice_fallback_url
154
150
  # @param [String] voice_method The voice_method
155
151
  # @param [String] voice_url The voice_url
156
-
157
152
  # @return [TollFreeInstance] Newly created TollFreeInstance
158
153
  def create(phone_number: nil, api_version: nil, friendly_name: nil, sms_application_sid: nil, sms_fallback_method: nil, sms_fallback_url: nil, sms_method: nil, sms_url: nil, status_callback: nil, status_callback_method: nil, voice_application_sid: nil, voice_caller_id_lookup: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_url: nil)
159
154
  data = {
@@ -184,7 +179,7 @@ module Twilio
184
179
  return TollFreeInstance.new(
185
180
  @version,
186
181
  payload,
187
- owner_account_sid: @solution['owner_account_sid'],
182
+ owner_account_sid: @solution[:owner_account_sid],
188
183
  )
189
184
  end
190
185
 
@@ -203,7 +198,6 @@ module Twilio
203
198
  # @param [Hash] solution Path solution for the resource
204
199
  # @param [String] owner_account_sid A 34 character string that uniquely identifies
205
200
  # this resource.
206
-
207
201
  # @return [TollFreePage] TollFreePage
208
202
  def initialize(version, response, solution)
209
203
  super(version, response)
@@ -215,13 +209,12 @@ module Twilio
215
209
  ##
216
210
  # Build an instance of TollFreeInstance
217
211
  # @param [Hash] payload Payload response from the API
218
-
219
212
  # @return [TollFreeInstance] TollFreeInstance
220
213
  def get_instance(payload)
221
214
  return TollFreeInstance.new(
222
215
  @version,
223
216
  payload,
224
- owner_account_sid: @solution['owner_account_sid'],
217
+ owner_account_sid: @solution[:owner_account_sid],
225
218
  )
226
219
  end
227
220
 
@@ -239,7 +232,6 @@ module Twilio
239
232
  # @param [Hash] payload payload that contains response from Twilio
240
233
  # @param [String] owner_account_sid A 34 character string that uniquely identifies
241
234
  # this resource.
242
-
243
235
  # @return [TollFreeInstance] TollFreeInstance
244
236
  def initialize(version, payload, owner_account_sid: nil)
245
237
  super(version)
@@ -15,7 +15,6 @@ module Twilio
15
15
  # @param [Version] version Version that contains the resource
16
16
  # @param [String] owner_account_sid A 34 character string that uniquely identifies
17
17
  # this resource.
18
-
19
18
  # @return [IncomingPhoneNumberList] IncomingPhoneNumberList
20
19
  def initialize(version, owner_account_sid: nil)
21
20
  super(version)
@@ -47,7 +46,6 @@ module Twilio
47
46
  # the default value of 50 records. If no page_size is defined
48
47
  # but a limit is defined, stream() will attempt to read the
49
48
  # limit with the most efficient page size, i.e. min(limit, 1000)
50
-
51
49
  # @return [Array] Array of up to limit results
52
50
  def list(beta: nil, friendly_name: nil, phone_number: nil, limit: nil, page_size: nil)
53
51
  self.stream(
@@ -74,7 +72,6 @@ module Twilio
74
72
  # the default value of 50 records. If no page_size is defined
75
73
  # but a limit is defined, stream() will attempt to read the
76
74
  # limit with the most efficient page size, i.e. min(limit, 1000)
77
-
78
75
  # @return [Enumerable] Enumerable that will yield up to limit results
79
76
  def stream(beta: nil, friendly_name: nil, phone_number: nil, limit: nil, page_size: nil)
80
77
  limits = @version.read_limits(limit, page_size)
@@ -127,7 +124,6 @@ module Twilio
127
124
  # @param [String] page_token PageToken provided by the API
128
125
  # @param [Integer] page_number Page Number, this value is simply for client state
129
126
  # @param [Integer] page_size Number of records to return, defaults to 50
130
-
131
127
  # @return [Page] Page of IncomingPhoneNumberInstance
132
128
  def page(beta: nil, friendly_name: nil, phone_number: nil, page_token: nil, page_number: nil, page_size: nil)
133
129
  params = {
@@ -190,7 +186,6 @@ module Twilio
190
186
  # (E.164 format)
191
187
  # @param [String] area_code The desired area code for the new phone number. Any
192
188
  # three digit US or Canada rea code is valid
193
-
194
189
  # @return [IncomingPhoneNumberInstance] Newly created IncomingPhoneNumberInstance
195
190
  def create(api_version: nil, friendly_name: nil, sms_application_sid: nil, sms_fallback_method: nil, sms_fallback_url: nil, sms_method: nil, sms_url: nil, status_callback: nil, status_callback_method: nil, voice_application_sid: nil, voice_caller_id_lookup: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_url: nil, phone_number: nil, area_code: nil)
196
191
  data = {
@@ -222,7 +217,7 @@ module Twilio
222
217
  return IncomingPhoneNumberInstance.new(
223
218
  @version,
224
219
  payload,
225
- owner_account_sid: @solution['owner_account_sid'],
220
+ owner_account_sid: @solution[:owner_account_sid],
226
221
  )
227
222
  end
228
223
 
@@ -271,7 +266,6 @@ module Twilio
271
266
  # @param [Hash] solution Path solution for the resource
272
267
  # @param [String] owner_account_sid A 34 character string that uniquely identifies
273
268
  # this resource.
274
-
275
269
  # @return [IncomingPhoneNumberPage] IncomingPhoneNumberPage
276
270
  def initialize(version, response, solution)
277
271
  super(version, response)
@@ -283,13 +277,12 @@ module Twilio
283
277
  ##
284
278
  # Build an instance of IncomingPhoneNumberInstance
285
279
  # @param [Hash] payload Payload response from the API
286
-
287
280
  # @return [IncomingPhoneNumberInstance] IncomingPhoneNumberInstance
288
281
  def get_instance(payload)
289
282
  return IncomingPhoneNumberInstance.new(
290
283
  @version,
291
284
  payload,
292
- owner_account_sid: @solution['owner_account_sid'],
285
+ owner_account_sid: @solution[:owner_account_sid],
293
286
  )
294
287
  end
295
288
 
@@ -307,7 +300,6 @@ module Twilio
307
300
  # @param [String] owner_account_sid The owner_account_sid
308
301
  # @param [String] sid The incoming-phone-number Sid that uniquely identifies this
309
302
  # resource
310
-
311
303
  # @return [IncomingPhoneNumberContext] IncomingPhoneNumberContext
312
304
  def initialize(version, owner_account_sid, sid)
313
305
  super(version)
@@ -361,7 +353,6 @@ module Twilio
361
353
  # @param [String] voice_url The URL Twilio will request when this phone number
362
354
  # receives a call. The VoiceURL will no longer be used if a `VoiceApplicationSid`
363
355
  # or a `TrunkSid` is set.
364
-
365
356
  # @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
366
357
  def update(account_sid: nil, api_version: nil, friendly_name: nil, sms_application_sid: nil, sms_fallback_method: nil, sms_fallback_url: nil, sms_method: nil, sms_url: nil, status_callback: nil, status_callback_method: nil, voice_application_sid: nil, voice_caller_id_lookup: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_url: nil)
367
358
  data = {
@@ -392,8 +383,8 @@ module Twilio
392
383
  return IncomingPhoneNumberInstance.new(
393
384
  @version,
394
385
  payload,
395
- owner_account_sid: @solution['owner_account_sid'],
396
- sid: @solution['sid'],
386
+ owner_account_sid: @solution[:owner_account_sid],
387
+ sid: @solution[:sid],
397
388
  )
398
389
  end
399
390
 
@@ -412,8 +403,8 @@ module Twilio
412
403
  return IncomingPhoneNumberInstance.new(
413
404
  @version,
414
405
  payload,
415
- owner_account_sid: @solution['owner_account_sid'],
416
- sid: @solution['sid'],
406
+ owner_account_sid: @solution[:owner_account_sid],
407
+ sid: @solution[:sid],
417
408
  )
418
409
  end
419
410
 
@@ -441,7 +432,6 @@ module Twilio
441
432
  # this resource.
442
433
  # @param [String] sid The incoming-phone-number Sid that uniquely identifies this
443
434
  # resource
444
-
445
435
  # @return [IncomingPhoneNumberInstance] IncomingPhoneNumberInstance
446
436
  def initialize(version, payload, owner_account_sid: nil, sid: nil)
447
437
  super(version)
@@ -486,7 +476,6 @@ module Twilio
486
476
  # Generate an instance context for the instance, the context is capable of
487
477
  # performing various actions. All instance actions are proxied to the context
488
478
  # @param [Version] version Version that contains the resource
489
-
490
479
  # @return [IncomingPhoneNumberContext] IncomingPhoneNumberContext for this IncomingPhoneNumberInstance
491
480
  def context
492
481
  unless @instance_context
@@ -636,10 +625,10 @@ module Twilio
636
625
  # @param [String] voice_url The URL Twilio will request when this phone number
637
626
  # receives a call. The VoiceURL will no longer be used if a `VoiceApplicationSid`
638
627
  # or a `TrunkSid` is set.
639
-
640
628
  # @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
641
629
  def update(account_sid: nil, api_version: nil, friendly_name: nil, sms_application_sid: nil, sms_fallback_method: nil, sms_fallback_url: nil, sms_method: nil, sms_url: nil, status_callback: nil, status_callback_method: nil, voice_application_sid: nil, voice_caller_id_lookup: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_url: nil)
642
- @context.update(
630
+ context.update(
631
+ account_sid: account_sid,
643
632
  api_version: api_version,
644
633
  friendly_name: friendly_name,
645
634
  sms_application_sid: sms_application_sid,
@@ -662,21 +651,21 @@ module Twilio
662
651
  # Fetch a IncomingPhoneNumberInstance
663
652
  # @return [IncomingPhoneNumberInstance] Fetched IncomingPhoneNumberInstance
664
653
  def fetch
665
- @context.fetch()
654
+ context.fetch
666
655
  end
667
656
 
668
657
  ##
669
658
  # Deletes the IncomingPhoneNumberInstance
670
659
  # @return [Boolean] true if delete succeeds, true otherwise
671
660
  def delete
672
- @context.delete()
661
+ context.delete
673
662
  end
674
663
 
675
664
  ##
676
665
  # Provide a user friendly representation
677
666
  def to_s
678
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
679
- "<Twilio.Api.V2010.IncomingPhoneNumberInstance #{context}>"
667
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
668
+ "<Twilio.Api.V2010.IncomingPhoneNumberInstance #{values}>"
680
669
  end
681
670
  end
682
671
  end
@@ -0,0 +1,324 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Api < Domain
10
+ class V2010 < Version
11
+ class AccountContext < InstanceContext
12
+ class KeyList < ListResource
13
+ ##
14
+ # Initialize the KeyList
15
+ # @param [Version] version Version that contains the resource
16
+ # @param [String] account_sid A 34 character string that uniquely identifies this
17
+ # resource.
18
+ # @return [KeyList] KeyList
19
+ def initialize(version, account_sid: nil)
20
+ super(version)
21
+
22
+ # Path Solution
23
+ @solution = {
24
+ account_sid: account_sid
25
+ }
26
+ @uri = "/Accounts/#{@solution[:account_sid]}/Keys.json"
27
+ end
28
+
29
+ ##
30
+ # Lists KeyInstance records from the API as a list.
31
+ # Unlike stream(), this operation is eager and will load `limit` records into
32
+ # memory before returning.
33
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
34
+ # guarantees to never return more than limit. Default is no limit
35
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
36
+ # the default value of 50 records. If no page_size is defined
37
+ # but a limit is defined, stream() will attempt to read the
38
+ # limit with the most efficient page size, i.e. min(limit, 1000)
39
+ # @return [Array] Array of up to limit results
40
+ def list(limit: nil, page_size: nil)
41
+ self.stream(
42
+ limit: limit,
43
+ page_size: page_size
44
+ ).entries
45
+ end
46
+
47
+ ##
48
+ # Streams KeyInstance records from the API as an Enumerable.
49
+ # This operation lazily loads records as efficiently as possible until the limit
50
+ # is reached.
51
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
52
+ # guarantees to never return more than limit. Default is no limit
53
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
54
+ # the default value of 50 records. If no page_size is defined
55
+ # but a limit is defined, stream() will attempt to read the
56
+ # limit with the most efficient page size, i.e. min(limit, 1000)
57
+ # @return [Enumerable] Enumerable that will yield up to limit results
58
+ def stream(limit: nil, page_size: nil)
59
+ limits = @version.read_limits(limit, page_size)
60
+
61
+ page = self.page(
62
+ page_size: limits['page_size'],
63
+ )
64
+
65
+ @version.stream(page, limit: limits['limit'], page_limit: limits['page_limit'])
66
+ end
67
+
68
+ ##
69
+ # When passed a block, yields KeyInstance records from the API.
70
+ # This operation lazily loads records as efficiently as possible until the limit
71
+ # is reached.
72
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
73
+ # guarantees to never return more than limit. Default is no limit
74
+ # @param [Integer] page_size Number of records to fetch per request, when not set will use
75
+ # the default value of 50 records. If no page_size is defined
76
+ # but a limit is defined, stream() will attempt to read the
77
+ # limit with the most efficient page size, i.e. min(limit, 1000)
78
+ def each
79
+ limits = @version.read_limits
80
+
81
+ page = self.page(
82
+ page_size: limits['page_size'],
83
+ )
84
+
85
+ @version.stream(page,
86
+ limit: limits['limit'],
87
+ page_limit: limits['page_limit']).each {|x| yield x}
88
+ end
89
+
90
+ ##
91
+ # Retrieve a single page of KeyInstance records from the API.
92
+ # Request is executed immediately.
93
+ # @param [String] page_token PageToken provided by the API
94
+ # @param [Integer] page_number Page Number, this value is simply for client state
95
+ # @param [Integer] page_size Number of records to return, defaults to 50
96
+ # @return [Page] Page of KeyInstance
97
+ def page(page_token: nil, page_number: nil, page_size: nil)
98
+ params = {
99
+ 'PageToken' => page_token,
100
+ 'Page' => page_number,
101
+ 'PageSize' => page_size,
102
+ }
103
+ response = @version.page(
104
+ 'GET',
105
+ @uri,
106
+ params
107
+ )
108
+ return KeyPage.new(@version, response, @solution)
109
+ end
110
+
111
+ ##
112
+ # Provide a user friendly representation
113
+ def to_s
114
+ '#<Twilio.Api.V2010.KeyList>'
115
+ end
116
+ end
117
+
118
+ class KeyPage < Page
119
+ ##
120
+ # Initialize the KeyPage
121
+ # @param [Version] version Version that contains the resource
122
+ # @param [Response] response Response from the API
123
+ # @param [Hash] solution Path solution for the resource
124
+ # @param [String] account_sid A 34 character string that uniquely identifies this
125
+ # resource.
126
+ # @return [KeyPage] KeyPage
127
+ def initialize(version, response, solution)
128
+ super(version, response)
129
+
130
+ # Path Solution
131
+ @solution = solution
132
+ end
133
+
134
+ ##
135
+ # Build an instance of KeyInstance
136
+ # @param [Hash] payload Payload response from the API
137
+ # @return [KeyInstance] KeyInstance
138
+ def get_instance(payload)
139
+ return KeyInstance.new(
140
+ @version,
141
+ payload,
142
+ account_sid: @solution[:account_sid],
143
+ )
144
+ end
145
+
146
+ ##
147
+ # Provide a user friendly representation
148
+ def to_s
149
+ '<Twilio.Api.V2010.KeyPage>'
150
+ end
151
+ end
152
+
153
+ class KeyContext < InstanceContext
154
+ ##
155
+ # Initialize the KeyContext
156
+ # @param [Version] version Version that contains the resource
157
+ # @param [String] account_sid The account_sid
158
+ # @param [String] sid The sid
159
+ # @return [KeyContext] KeyContext
160
+ def initialize(version, account_sid, sid)
161
+ super(version)
162
+
163
+ # Path Solution
164
+ @solution = {
165
+ account_sid: account_sid,
166
+ sid: sid,
167
+ }
168
+ @uri = "/Accounts/#{@solution[:account_sid]}/Keys/#{@solution[:sid]}.json"
169
+ end
170
+
171
+ ##
172
+ # Fetch a KeyInstance
173
+ # @return [KeyInstance] Fetched KeyInstance
174
+ def fetch
175
+ params = {}
176
+
177
+ payload = @version.fetch(
178
+ 'GET',
179
+ @uri,
180
+ params,
181
+ )
182
+
183
+ return KeyInstance.new(
184
+ @version,
185
+ payload,
186
+ account_sid: @solution[:account_sid],
187
+ sid: @solution[:sid],
188
+ )
189
+ end
190
+
191
+ ##
192
+ # Update the KeyInstance
193
+ # @param [String] friendly_name The friendly_name
194
+ # @return [KeyInstance] Updated KeyInstance
195
+ def update(friendly_name: nil)
196
+ data = {
197
+ 'FriendlyName' => friendly_name,
198
+ }
199
+
200
+ payload = @version.update(
201
+ 'POST',
202
+ @uri,
203
+ data: data,
204
+ )
205
+
206
+ return KeyInstance.new(
207
+ @version,
208
+ payload,
209
+ account_sid: @solution[:account_sid],
210
+ sid: @solution[:sid],
211
+ )
212
+ end
213
+
214
+ ##
215
+ # Deletes the KeyInstance
216
+ # @return [Boolean] true if delete succeeds, true otherwise
217
+ def delete
218
+ return @version.delete('delete', @uri)
219
+ end
220
+
221
+ ##
222
+ # Provide a user friendly representation
223
+ def to_s
224
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
225
+ "#<Twilio.Api.V2010.KeyContext #{context}>"
226
+ end
227
+ end
228
+
229
+ class KeyInstance < InstanceResource
230
+ ##
231
+ # Initialize the KeyInstance
232
+ # @param [Version] version Version that contains the resource
233
+ # @param [Hash] payload payload that contains response from Twilio
234
+ # @param [String] account_sid A 34 character string that uniquely identifies this
235
+ # resource.
236
+ # @param [String] sid The sid
237
+ # @return [KeyInstance] KeyInstance
238
+ def initialize(version, payload, account_sid: nil, sid: nil)
239
+ super(version)
240
+
241
+ # Marshaled Properties
242
+ @properties = {
243
+ 'sid' => payload['sid'],
244
+ 'friendly_name' => payload['friendly_name'],
245
+ 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
246
+ 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
247
+ }
248
+
249
+ # Context
250
+ @instance_context = nil
251
+ @params = {
252
+ 'account_sid' => account_sid,
253
+ 'sid' => sid || @properties['sid'],
254
+ }
255
+ end
256
+
257
+ ##
258
+ # Generate an instance context for the instance, the context is capable of
259
+ # performing various actions. All instance actions are proxied to the context
260
+ # @param [Version] version Version that contains the resource
261
+ # @return [KeyContext] KeyContext for this KeyInstance
262
+ def context
263
+ unless @instance_context
264
+ @instance_context = KeyContext.new(
265
+ @version,
266
+ @params['account_sid'],
267
+ @params['sid'],
268
+ )
269
+ end
270
+ @instance_context
271
+ end
272
+
273
+ def sid
274
+ @properties['sid']
275
+ end
276
+
277
+ def friendly_name
278
+ @properties['friendly_name']
279
+ end
280
+
281
+ def date_created
282
+ @properties['date_created']
283
+ end
284
+
285
+ def date_updated
286
+ @properties['date_updated']
287
+ end
288
+
289
+ ##
290
+ # Fetch a KeyInstance
291
+ # @return [KeyInstance] Fetched KeyInstance
292
+ def fetch
293
+ context.fetch
294
+ end
295
+
296
+ ##
297
+ # Update the KeyInstance
298
+ # @param [String] friendly_name The friendly_name
299
+ # @return [KeyInstance] Updated KeyInstance
300
+ def update(friendly_name: nil)
301
+ context.update(
302
+ friendly_name: friendly_name,
303
+ )
304
+ end
305
+
306
+ ##
307
+ # Deletes the KeyInstance
308
+ # @return [Boolean] true if delete succeeds, true otherwise
309
+ def delete
310
+ context.delete
311
+ end
312
+
313
+ ##
314
+ # Provide a user friendly representation
315
+ def to_s
316
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
317
+ "<Twilio.Api.V2010.KeyInstance #{values}>"
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end
323
+ end
324
+ end