twilio-ruby 5.60.0 → 5.62.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test-and-deploy.yml +95 -0
  3. data/.gitignore +3 -1
  4. data/.rubocop.yml +1 -1
  5. data/CHANGES.md +98 -0
  6. data/Makefile +3 -4
  7. data/README.md +4 -4
  8. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +3 -3
  9. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -1
  10. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
  11. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
  12. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
  13. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +31 -6
  14. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  15. data/lib/twilio-ruby/rest/insights/v1.rb +7 -0
  16. data/lib/twilio-ruby/rest/insights.rb +6 -0
  17. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +15 -2
  18. data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_vetting.rb +84 -3
  19. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +9 -3
  20. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +416 -0
  21. data/lib/twilio-ruby/rest/supersim/v1.rb +16 -0
  22. data/lib/twilio-ruby/rest/supersim.rb +9 -0
  23. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +8 -2
  24. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +8 -2
  25. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +16 -6
  26. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +5 -5
  27. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +9 -1
  28. data/lib/twilio-ruby/rest/verify/v2/service.rb +22 -3
  29. data/lib/twilio-ruby/rest/video/v1/room.rb +34 -1
  30. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  31. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  32. data/lib/twilio-ruby/rest/voice.rb +8 -0
  33. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  34. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
  35. data/lib/twilio-ruby/twiml/voice_response.rb +613 -36
  36. data/lib/twilio-ruby/version.rb +1 -1
  37. metadata +9 -4
  38. data/.travis.yml +0 -57
@@ -94,10 +94,19 @@ module Twilio
94
94
  # @param [String] avatar The avatar URL which will be shown in Frontline
95
95
  # application.
96
96
  # @param [user.StateType] state Current state of this user. Can be either `active`
97
- # or `deactivated` and defaults to `active`
97
+ # or `deactivated`.
98
+ # @param [Boolean] is_available Whether the User is available for new
99
+ # conversations. Set to `false` to prevent User from receiving new inbound
100
+ # conversations if you are using {Pool
101
+ # Routing}[https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing].
98
102
  # @return [UserInstance] Updated UserInstance
99
- def update(friendly_name: :unset, avatar: :unset, state: :unset)
100
- data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Avatar' => avatar, 'State' => state, })
103
+ def update(friendly_name: :unset, avatar: :unset, state: :unset, is_available: :unset)
104
+ data = Twilio::Values.of({
105
+ 'FriendlyName' => friendly_name,
106
+ 'Avatar' => avatar,
107
+ 'State' => state,
108
+ 'IsAvailable' => is_available,
109
+ })
101
110
 
102
111
  payload = @version.update('POST', @uri, data: data)
103
112
 
@@ -139,6 +148,7 @@ module Twilio
139
148
  'friendly_name' => payload['friendly_name'],
140
149
  'avatar' => payload['avatar'],
141
150
  'state' => payload['state'],
151
+ 'is_available' => payload['is_available'],
142
152
  'url' => payload['url'],
143
153
  }
144
154
 
@@ -188,6 +198,12 @@ module Twilio
188
198
  @properties['state']
189
199
  end
190
200
 
201
+ ##
202
+ # @return [Boolean] Whether the User is available for new conversations
203
+ def is_available
204
+ @properties['is_available']
205
+ end
206
+
191
207
  ##
192
208
  # @return [String] An absolute URL for this user.
193
209
  def url
@@ -207,10 +223,19 @@ module Twilio
207
223
  # @param [String] avatar The avatar URL which will be shown in Frontline
208
224
  # application.
209
225
  # @param [user.StateType] state Current state of this user. Can be either `active`
210
- # or `deactivated` and defaults to `active`
226
+ # or `deactivated`.
227
+ # @param [Boolean] is_available Whether the User is available for new
228
+ # conversations. Set to `false` to prevent User from receiving new inbound
229
+ # conversations if you are using {Pool
230
+ # Routing}[https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing].
211
231
  # @return [UserInstance] Updated UserInstance
212
- def update(friendly_name: :unset, avatar: :unset, state: :unset)
213
- context.update(friendly_name: friendly_name, avatar: avatar, state: state, )
232
+ def update(friendly_name: :unset, avatar: :unset, state: :unset, is_available: :unset)
233
+ context.update(
234
+ friendly_name: friendly_name,
235
+ avatar: avatar,
236
+ state: state,
237
+ is_available: is_available,
238
+ )
214
239
  end
215
240
 
216
241
  ##
@@ -0,0 +1,215 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Insights < Domain
12
+ class V1 < Version
13
+ class SettingList < ListResource
14
+ ##
15
+ # Initialize the SettingList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [SettingList] SettingList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Insights.V1.SettingList>'
29
+ end
30
+ end
31
+
32
+ class SettingPage < Page
33
+ ##
34
+ # Initialize the SettingPage
35
+ # @param [Version] version Version that contains the resource
36
+ # @param [Response] response Response from the API
37
+ # @param [Hash] solution Path solution for the resource
38
+ # @return [SettingPage] SettingPage
39
+ def initialize(version, response, solution)
40
+ super(version, response)
41
+
42
+ # Path Solution
43
+ @solution = solution
44
+ end
45
+
46
+ ##
47
+ # Build an instance of SettingInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [SettingInstance] SettingInstance
50
+ def get_instance(payload)
51
+ SettingInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Insights.V1.SettingPage>'
58
+ end
59
+ end
60
+
61
+ class SettingContext < InstanceContext
62
+ ##
63
+ # Initialize the SettingContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @return [SettingContext] SettingContext
66
+ def initialize(version)
67
+ super(version)
68
+
69
+ # Path Solution
70
+ @solution = {}
71
+ @uri = "/Voice/Settings"
72
+ end
73
+
74
+ ##
75
+ # Fetch the SettingInstance
76
+ # @param [String] subaccount_sid The subaccount_sid
77
+ # @return [SettingInstance] Fetched SettingInstance
78
+ def fetch(subaccount_sid: :unset)
79
+ params = Twilio::Values.of({'SubaccountSid' => subaccount_sid, })
80
+
81
+ payload = @version.fetch('GET', @uri, params: params)
82
+
83
+ SettingInstance.new(@version, payload, )
84
+ end
85
+
86
+ ##
87
+ # Update the SettingInstance
88
+ # @param [Boolean] advanced_features The advanced_features
89
+ # @param [Boolean] voice_trace The voice_trace
90
+ # @param [String] subaccount_sid The subaccount_sid
91
+ # @return [SettingInstance] Updated SettingInstance
92
+ def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
93
+ data = Twilio::Values.of({
94
+ 'AdvancedFeatures' => advanced_features,
95
+ 'VoiceTrace' => voice_trace,
96
+ 'SubaccountSid' => subaccount_sid,
97
+ })
98
+
99
+ payload = @version.update('POST', @uri, data: data)
100
+
101
+ SettingInstance.new(@version, payload, )
102
+ end
103
+
104
+ ##
105
+ # Provide a user friendly representation
106
+ def to_s
107
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
108
+ "#<Twilio.Insights.V1.SettingContext #{context}>"
109
+ end
110
+
111
+ ##
112
+ # Provide a detailed, user friendly representation
113
+ def inspect
114
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
115
+ "#<Twilio.Insights.V1.SettingContext #{context}>"
116
+ end
117
+ end
118
+
119
+ class SettingInstance < InstanceResource
120
+ ##
121
+ # Initialize the SettingInstance
122
+ # @param [Version] version Version that contains the resource
123
+ # @param [Hash] payload payload that contains response from Twilio
124
+ # @return [SettingInstance] SettingInstance
125
+ def initialize(version, payload)
126
+ super(version)
127
+
128
+ # Marshaled Properties
129
+ @properties = {
130
+ 'account_sid' => payload['account_sid'],
131
+ 'advanced_features' => payload['advanced_features'],
132
+ 'voice_trace' => payload['voice_trace'],
133
+ 'url' => payload['url'],
134
+ }
135
+
136
+ # Context
137
+ @instance_context = nil
138
+ @params = {}
139
+ end
140
+
141
+ ##
142
+ # Generate an instance context for the instance, the context is capable of
143
+ # performing various actions. All instance actions are proxied to the context
144
+ # @return [SettingContext] SettingContext for this SettingInstance
145
+ def context
146
+ unless @instance_context
147
+ @instance_context = SettingContext.new(@version, )
148
+ end
149
+ @instance_context
150
+ end
151
+
152
+ ##
153
+ # @return [String] The account_sid
154
+ def account_sid
155
+ @properties['account_sid']
156
+ end
157
+
158
+ ##
159
+ # @return [Boolean] The advanced_features
160
+ def advanced_features
161
+ @properties['advanced_features']
162
+ end
163
+
164
+ ##
165
+ # @return [Boolean] The voice_trace
166
+ def voice_trace
167
+ @properties['voice_trace']
168
+ end
169
+
170
+ ##
171
+ # @return [String] The url
172
+ def url
173
+ @properties['url']
174
+ end
175
+
176
+ ##
177
+ # Fetch the SettingInstance
178
+ # @param [String] subaccount_sid The subaccount_sid
179
+ # @return [SettingInstance] Fetched SettingInstance
180
+ def fetch(subaccount_sid: :unset)
181
+ context.fetch(subaccount_sid: subaccount_sid, )
182
+ end
183
+
184
+ ##
185
+ # Update the SettingInstance
186
+ # @param [Boolean] advanced_features The advanced_features
187
+ # @param [Boolean] voice_trace The voice_trace
188
+ # @param [String] subaccount_sid The subaccount_sid
189
+ # @return [SettingInstance] Updated SettingInstance
190
+ def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
191
+ context.update(
192
+ advanced_features: advanced_features,
193
+ voice_trace: voice_trace,
194
+ subaccount_sid: subaccount_sid,
195
+ )
196
+ end
197
+
198
+ ##
199
+ # Provide a user friendly representation
200
+ def to_s
201
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
202
+ "<Twilio.Insights.V1.SettingInstance #{values}>"
203
+ end
204
+
205
+ ##
206
+ # Provide a detailed, user friendly representation
207
+ def inspect
208
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
209
+ "<Twilio.Insights.V1.SettingInstance #{values}>"
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
@@ -15,11 +15,18 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'v1'
18
+ @settings = nil
18
19
  @calls = nil
19
20
  @call_summaries = nil
20
21
  @rooms = nil
21
22
  end
22
23
 
24
+ ##
25
+ # @return [Twilio::REST::Insights::V1::SettingContext]
26
+ def settings
27
+ @settings ||= SettingContext.new self
28
+ end
29
+
23
30
  ##
24
31
  # @param [String] sid The sid
25
32
  # @return [Twilio::REST::Insights::V1::CallContext] if sid was passed.
@@ -28,6 +28,12 @@ module Twilio
28
28
  @v1 ||= V1.new self
29
29
  end
30
30
 
31
+ ##
32
+ # @return [Twilio::REST::Insights::V1::SettingInstance]
33
+ def settings
34
+ self.v1.settings()
35
+ end
36
+
31
37
  ##
32
38
  # @param [String] sid The sid
33
39
  # @return [Twilio::REST::Insights::V1::CallInstance] if sid was passed.
@@ -27,7 +27,7 @@ module Twilio
27
27
  # Create the MediaProcessorInstance
28
28
  # @param [String] extension The {Media
29
29
  # Extension}[/docs/live/api/media-extensions-overview] name or URL. Ex:
30
- # `video-composer-v1-preview`
30
+ # `video-composer-v1`
31
31
  # @param [String] extension_context The context of the Media Extension,
32
32
  # represented as a JSON dictionary. See the documentation for the specific {Media
33
33
  # Extension}[/docs/live/api/media-extensions-overview] you are using for more
@@ -42,14 +42,20 @@ module Twilio
42
42
  # Callbacks}[/docs/live/status-callbacks] for details.
43
43
  # @param [String] status_callback_method The HTTP method Twilio should use to call
44
44
  # the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
45
+ # @param [String] max_duration The maximum time, in seconds, that the
46
+ # MediaProcessor can run before automatically ends. The default value is 300
47
+ # seconds, and the maximum value is 90000 seconds. Once this maximum duration is
48
+ # reached, Twilio will end the MediaProcessor, regardless of whether media is
49
+ # still streaming.
45
50
  # @return [MediaProcessorInstance] Created MediaProcessorInstance
46
- def create(extension: nil, extension_context: nil, extension_environment: :unset, status_callback: :unset, status_callback_method: :unset)
51
+ def create(extension: nil, extension_context: nil, extension_environment: :unset, status_callback: :unset, status_callback_method: :unset, max_duration: :unset)
47
52
  data = Twilio::Values.of({
48
53
  'Extension' => extension,
49
54
  'ExtensionContext' => extension_context,
50
55
  'ExtensionEnvironment' => Twilio.serialize_object(extension_environment),
51
56
  'StatusCallback' => status_callback,
52
57
  'StatusCallbackMethod' => status_callback_method,
58
+ 'MaxDuration' => max_duration,
53
59
  })
54
60
 
55
61
  payload = @version.create('POST', @uri, data: data)
@@ -264,6 +270,7 @@ module Twilio
264
270
  'ended_reason' => payload['ended_reason'],
265
271
  'status_callback' => payload['status_callback'],
266
272
  'status_callback_method' => payload['status_callback_method'],
273
+ 'max_duration' => payload['max_duration'].to_i,
267
274
  }
268
275
 
269
276
  # Context
@@ -348,6 +355,12 @@ module Twilio
348
355
  @properties['status_callback_method']
349
356
  end
350
357
 
358
+ ##
359
+ # @return [String] Maximum MediaProcessor duration in minutes
360
+ def max_duration
361
+ @properties['max_duration']
362
+ end
363
+
351
364
  ##
352
365
  # Fetch the MediaProcessorInstance
353
366
  # @return [MediaProcessorInstance] Fetched MediaProcessorInstance
@@ -166,6 +166,54 @@ module Twilio
166
166
  end
167
167
  end
168
168
 
169
+ ##
170
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
171
+ class BrandVettingContext < InstanceContext
172
+ ##
173
+ # Initialize the BrandVettingContext
174
+ # @param [Version] version Version that contains the resource
175
+ # @param [String] brand_sid The SID of the Brand Registration resource of the
176
+ # vettings to read .
177
+ # @param [String] brand_vetting_sid The Twilio SID of the third-party vetting
178
+ # record.
179
+ # @return [BrandVettingContext] BrandVettingContext
180
+ def initialize(version, brand_sid, brand_vetting_sid)
181
+ super(version)
182
+
183
+ # Path Solution
184
+ @solution = {brand_sid: brand_sid, brand_vetting_sid: brand_vetting_sid, }
185
+ @uri = "/a2p/BrandRegistrations/#{@solution[:brand_sid]}/Vettings/#{@solution[:brand_vetting_sid]}"
186
+ end
187
+
188
+ ##
189
+ # Fetch the BrandVettingInstance
190
+ # @return [BrandVettingInstance] Fetched BrandVettingInstance
191
+ def fetch
192
+ payload = @version.fetch('GET', @uri)
193
+
194
+ BrandVettingInstance.new(
195
+ @version,
196
+ payload,
197
+ brand_sid: @solution[:brand_sid],
198
+ brand_vetting_sid: @solution[:brand_vetting_sid],
199
+ )
200
+ end
201
+
202
+ ##
203
+ # Provide a user friendly representation
204
+ def to_s
205
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
206
+ "#<Twilio.Messaging.V1.BrandVettingContext #{context}>"
207
+ end
208
+
209
+ ##
210
+ # Provide a detailed, user friendly representation
211
+ def inspect
212
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
213
+ "#<Twilio.Messaging.V1.BrandVettingContext #{context}>"
214
+ end
215
+ end
216
+
169
217
  ##
170
218
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
171
219
  class BrandVettingInstance < InstanceResource
@@ -174,8 +222,10 @@ module Twilio
174
222
  # @param [Version] version Version that contains the resource
175
223
  # @param [Hash] payload payload that contains response from Twilio
176
224
  # @param [String] brand_sid The unique string to identify Brand Registration.
225
+ # @param [String] brand_vetting_sid The Twilio SID of the third-party vetting
226
+ # record.
177
227
  # @return [BrandVettingInstance] BrandVettingInstance
178
- def initialize(version, payload, brand_sid: nil)
228
+ def initialize(version, payload, brand_sid: nil, brand_vetting_sid: nil)
179
229
  super(version)
180
230
 
181
231
  # Marshaled Properties
@@ -191,6 +241,28 @@ module Twilio
191
241
  'vetting_provider' => payload['vetting_provider'],
192
242
  'url' => payload['url'],
193
243
  }
244
+
245
+ # Context
246
+ @instance_context = nil
247
+ @params = {
248
+ 'brand_sid' => brand_sid,
249
+ 'brand_vetting_sid' => brand_vetting_sid || @properties['brand_vetting_sid'],
250
+ }
251
+ end
252
+
253
+ ##
254
+ # Generate an instance context for the instance, the context is capable of
255
+ # performing various actions. All instance actions are proxied to the context
256
+ # @return [BrandVettingContext] BrandVettingContext for this BrandVettingInstance
257
+ def context
258
+ unless @instance_context
259
+ @instance_context = BrandVettingContext.new(
260
+ @version,
261
+ @params['brand_sid'],
262
+ @params['brand_vetting_sid'],
263
+ )
264
+ end
265
+ @instance_context
194
266
  end
195
267
 
196
268
  ##
@@ -253,16 +325,25 @@ module Twilio
253
325
  @properties['url']
254
326
  end
255
327
 
328
+ ##
329
+ # Fetch the BrandVettingInstance
330
+ # @return [BrandVettingInstance] Fetched BrandVettingInstance
331
+ def fetch
332
+ context.fetch
333
+ end
334
+
256
335
  ##
257
336
  # Provide a user friendly representation
258
337
  def to_s
259
- "<Twilio.Messaging.V1.BrandVettingInstance>"
338
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
339
+ "<Twilio.Messaging.V1.BrandVettingInstance #{values}>"
260
340
  end
261
341
 
262
342
  ##
263
343
  # Provide a detailed, user friendly representation
264
344
  def inspect
265
- "<Twilio.Messaging.V1.BrandVettingInstance>"
345
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
346
+ "<Twilio.Messaging.V1.BrandVettingInstance #{values}>"
266
347
  end
267
348
  end
268
349
  end
@@ -201,8 +201,14 @@ module Twilio
201
201
  ##
202
202
  # Access the brand_vettings
203
203
  # @return [BrandVettingList]
204
- # @return [BrandVettingContext]
205
- def brand_vettings
204
+ # @return [BrandVettingContext] if brand_vetting_sid was passed.
205
+ def brand_vettings(brand_vetting_sid=:unset)
206
+ raise ArgumentError, 'brand_vetting_sid cannot be nil' if brand_vetting_sid.nil?
207
+
208
+ if brand_vetting_sid != :unset
209
+ return BrandVettingContext.new(@version, @solution[:sid], brand_vetting_sid, )
210
+ end
211
+
206
212
  unless @brand_vettings
207
213
  @brand_vettings = BrandVettingList.new(@version, brand_sid: @solution[:sid], )
208
214
  end
@@ -319,7 +325,7 @@ module Twilio
319
325
  end
320
326
 
321
327
  ##
322
- # @return [brand_registration.Status] Brand Registration status
328
+ # @return [brand_registration.Status] Brand Registration status.
323
329
  def status
324
330
  @properties['status']
325
331
  end