twilio-ruby 7.0.1 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +55 -0
  3. data/Gemfile +1 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +6 -6
  6. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +1 -1
  7. data/lib/twilio-ruby/rest/client.rb +0 -5
  8. data/lib/twilio-ruby/rest/content/v2/content.rb +259 -0
  9. data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +252 -0
  10. data/lib/twilio-ruby/rest/content/v2.rb +46 -0
  11. data/lib/twilio-ruby/rest/content_base.rb +6 -1
  12. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -1
  13. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +8 -1
  14. data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +289 -0
  15. data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +5 -2
  16. data/lib/twilio-ruby/rest/flex_api/v2.rb +37 -0
  17. data/lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb +444 -0
  18. data/lib/twilio-ruby/rest/intelligence/v2/operator.rb +355 -0
  19. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +215 -0
  20. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +196 -0
  21. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +357 -0
  22. data/lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb +355 -0
  23. data/lib/twilio-ruby/rest/intelligence/v2/service.rb +9 -8
  24. data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +18 -18
  25. data/lib/twilio-ruby/rest/intelligence/v2.rb +112 -0
  26. data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -7
  27. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +154 -4
  28. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +292 -0
  29. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +148 -0
  30. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +167 -0
  31. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +160 -0
  32. data/lib/twilio-ruby/rest/numbers/v1.rb +63 -20
  33. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -1
  34. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -2
  35. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -2
  36. data/lib/twilio-ruby/rest/preview/sync/service.rb +2 -2
  37. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -1
  38. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -2
  39. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -2
  40. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
  41. data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
  42. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +33 -4
  43. data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +4 -1
  44. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +7 -0
  45. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +7 -0
  46. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  47. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +1 -1
  48. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  49. data/lib/twilio-ruby/version.rb +1 -1
  50. metadata +16 -9
  51. data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -230
  52. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -252
  53. data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +0 -164
  54. data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +0 -235
  55. data/lib/twilio-ruby/rest/preview_messaging/v1.rb +0 -46
  56. data/lib/twilio-ruby/rest/preview_messaging.rb +0 -12
  57. data/lib/twilio-ruby/rest/preview_messaging_base.rb +0 -38
@@ -0,0 +1,46 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Content
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+ module Twilio
16
+ module REST
17
+ class Content
18
+ class V2 < Version
19
+ ##
20
+ # Initialize the V2 version of Content
21
+ def initialize(domain)
22
+ super
23
+ @version = 'v2'
24
+ @contents = nil
25
+ @content_and_approvals = nil
26
+ end
27
+
28
+ ##
29
+ # @return [Twilio::REST::Content::V2::ContentList]
30
+ def contents
31
+ @contents ||= ContentList.new self
32
+ end
33
+ ##
34
+ # @return [Twilio::REST::Content::V2::ContentAndApprovalsList]
35
+ def content_and_approvals
36
+ @content_and_approvals ||= ContentAndApprovalsList.new self
37
+ end
38
+ ##
39
+ # Provide a user friendly representation
40
+ def to_s
41
+ '<Twilio::REST::Content::V2>';
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -22,16 +22,21 @@ module Twilio
22
22
  @host = "content.twilio.com"
23
23
  @port = 443
24
24
  @v1 = nil
25
+ @v2 = nil
25
26
  end
26
27
 
27
28
  def v1
28
29
  @v1 ||= Content::V1.new self
29
30
  end
30
31
 
32
+ def v2
33
+ @v2 ||= Content::V2.new self
34
+ end
35
+
31
36
  ##
32
37
  # Provide a user friendly representation
33
38
  def to_s
34
- '<Twilio::REST::Content::V1>';
39
+ '<Twilio::REST::Content>';
35
40
  end
36
41
  end
37
42
  end
@@ -38,7 +38,7 @@ module Twilio
38
38
  # @return [InteractionInstance] Created InteractionInstance
39
39
  def create(
40
40
  channel: nil,
41
- routing: nil,
41
+ routing: :unset,
42
42
  interaction_context_sid: :unset
43
43
  )
44
44
 
@@ -273,6 +273,7 @@ module Twilio
273
273
  'changelog' => payload['changelog'],
274
274
  'private' => payload['private'],
275
275
  'archived' => payload['archived'],
276
+ 'validated' => payload['validated'],
276
277
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
277
278
  'url' => payload['url'],
278
279
  }
@@ -330,7 +331,7 @@ module Twilio
330
331
  end
331
332
 
332
333
  ##
333
- # @return [Boolean] Whether to inject credentials while accessing this Plugin Version. The default value is false.
334
+ # @return [Boolean] Whether the Flex Plugin Version is validated. The default value is false.
334
335
  def private
335
336
  @properties['private']
336
337
  end
@@ -341,6 +342,12 @@ module Twilio
341
342
  @properties['archived']
342
343
  end
343
344
 
345
+ ##
346
+ # @return [Boolean]
347
+ def validated
348
+ @properties['validated']
349
+ end
350
+
344
351
  ##
345
352
  # @return [Time] The date and time in GMT when the Flex Plugin Version was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
346
353
  def date_created
@@ -0,0 +1,289 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Flex
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class FlexApi < FlexApiBase
19
+ class V2 < Version
20
+ class FlexUserList < ListResource
21
+
22
+ ##
23
+ # Initialize the FlexUserList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [FlexUserList] FlexUserList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+
31
+
32
+ end
33
+
34
+
35
+
36
+ # Provide a user friendly representation
37
+ def to_s
38
+ '#<Twilio.FlexApi.V2.FlexUserList>'
39
+ end
40
+ end
41
+
42
+
43
+ class FlexUserContext < InstanceContext
44
+ ##
45
+ # Initialize the FlexUserContext
46
+ # @param [Version] version Version that contains the resource
47
+ # @param [String] instance_sid The unique ID created by Twilio to identify a Flex instance.
48
+ # @param [String] flex_user_sid The unique id for the flex user to be retrieved.
49
+ # @return [FlexUserContext] FlexUserContext
50
+ def initialize(version, instance_sid, flex_user_sid)
51
+ super(version)
52
+
53
+ # Path Solution
54
+ @solution = { instance_sid: instance_sid, flex_user_sid: flex_user_sid, }
55
+ @uri = "/Instances/#{@solution[:instance_sid]}/Users/#{@solution[:flex_user_sid]}"
56
+
57
+
58
+ end
59
+ ##
60
+ # Fetch the FlexUserInstance
61
+ # @return [FlexUserInstance] Fetched FlexUserInstance
62
+ def fetch
63
+
64
+
65
+ payload = @version.fetch('GET', @uri)
66
+ FlexUserInstance.new(
67
+ @version,
68
+ payload,
69
+ instance_sid: @solution[:instance_sid],
70
+ flex_user_sid: @solution[:flex_user_sid],
71
+ )
72
+ end
73
+
74
+
75
+ ##
76
+ # Provide a user friendly representation
77
+ def to_s
78
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
79
+ "#<Twilio.FlexApi.V2.FlexUserContext #{context}>"
80
+ end
81
+
82
+ ##
83
+ # Provide a detailed, user friendly representation
84
+ def inspect
85
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
86
+ "#<Twilio.FlexApi.V2.FlexUserContext #{context}>"
87
+ end
88
+ end
89
+
90
+ class FlexUserPage < Page
91
+ ##
92
+ # Initialize the FlexUserPage
93
+ # @param [Version] version Version that contains the resource
94
+ # @param [Response] response Response from the API
95
+ # @param [Hash] solution Path solution for the resource
96
+ # @return [FlexUserPage] FlexUserPage
97
+ def initialize(version, response, solution)
98
+ super(version, response)
99
+
100
+ # Path Solution
101
+ @solution = solution
102
+ end
103
+
104
+ ##
105
+ # Build an instance of FlexUserInstance
106
+ # @param [Hash] payload Payload response from the API
107
+ # @return [FlexUserInstance] FlexUserInstance
108
+ def get_instance(payload)
109
+ FlexUserInstance.new(@version, payload)
110
+ end
111
+
112
+ ##
113
+ # Provide a user friendly representation
114
+ def to_s
115
+ '<Twilio.FlexApi.V2.FlexUserPage>'
116
+ end
117
+ end
118
+ class FlexUserInstance < InstanceResource
119
+ ##
120
+ # Initialize the FlexUserInstance
121
+ # @param [Version] version Version that contains the resource
122
+ # @param [Hash] payload payload that contains response from Twilio
123
+ # @param [String] account_sid The SID of the
124
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this FlexUser
125
+ # resource.
126
+ # @param [String] sid The SID of the Call resource to fetch.
127
+ # @return [FlexUserInstance] FlexUserInstance
128
+ def initialize(version, payload , instance_sid: nil, flex_user_sid: nil)
129
+ super(version)
130
+
131
+ # Marshaled Properties
132
+ @properties = {
133
+ 'account_sid' => payload['account_sid'],
134
+ 'instance_sid' => payload['instance_sid'],
135
+ 'user_sid' => payload['user_sid'],
136
+ 'flex_user_sid' => payload['flex_user_sid'],
137
+ 'worker_sid' => payload['worker_sid'],
138
+ 'workspace_sid' => payload['workspace_sid'],
139
+ 'flex_team_sid' => payload['flex_team_sid'],
140
+ 'first_name' => payload['first_name'],
141
+ 'last_name' => payload['last_name'],
142
+ 'username' => payload['username'],
143
+ 'email' => payload['email'],
144
+ 'friendly_name' => payload['friendly_name'],
145
+ 'created_date' => Twilio.deserialize_iso8601_datetime(payload['created_date']),
146
+ 'updated_date' => Twilio.deserialize_iso8601_datetime(payload['updated_date']),
147
+ 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i,
148
+ 'url' => payload['url'],
149
+ }
150
+
151
+ # Context
152
+ @instance_context = nil
153
+ @params = { 'instance_sid' => instance_sid || @properties['instance_sid'] ,'flex_user_sid' => flex_user_sid || @properties['flex_user_sid'] , }
154
+ end
155
+
156
+ ##
157
+ # Generate an instance context for the instance, the context is capable of
158
+ # performing various actions. All instance actions are proxied to the context
159
+ # @return [FlexUserContext] CallContext for this CallInstance
160
+ def context
161
+ unless @instance_context
162
+ @instance_context = FlexUserContext.new(@version , @params['instance_sid'], @params['flex_user_sid'])
163
+ end
164
+ @instance_context
165
+ end
166
+
167
+ ##
168
+ # @return [String] The unique SID of the account that created the resource.
169
+ def account_sid
170
+ @properties['account_sid']
171
+ end
172
+
173
+ ##
174
+ # @return [String] The unique ID created by Twilio to identify a Flex instance.
175
+ def instance_sid
176
+ @properties['instance_sid']
177
+ end
178
+
179
+ ##
180
+ # @return [String] The unique SID identifier of the Twilio Unified User.
181
+ def user_sid
182
+ @properties['user_sid']
183
+ end
184
+
185
+ ##
186
+ # @return [String] The unique SID identifier of the Flex User.
187
+ def flex_user_sid
188
+ @properties['flex_user_sid']
189
+ end
190
+
191
+ ##
192
+ # @return [String] The unique SID identifier of the worker.
193
+ def worker_sid
194
+ @properties['worker_sid']
195
+ end
196
+
197
+ ##
198
+ # @return [String] The unique SID identifier of the workspace.
199
+ def workspace_sid
200
+ @properties['workspace_sid']
201
+ end
202
+
203
+ ##
204
+ # @return [String] The unique SID identifier of the Flex Team.
205
+ def flex_team_sid
206
+ @properties['flex_team_sid']
207
+ end
208
+
209
+ ##
210
+ # @return [String] First name of the User.
211
+ def first_name
212
+ @properties['first_name']
213
+ end
214
+
215
+ ##
216
+ # @return [String] Last name of the User.
217
+ def last_name
218
+ @properties['last_name']
219
+ end
220
+
221
+ ##
222
+ # @return [String] Username of the User.
223
+ def username
224
+ @properties['username']
225
+ end
226
+
227
+ ##
228
+ # @return [String] Email of the User.
229
+ def email
230
+ @properties['email']
231
+ end
232
+
233
+ ##
234
+ # @return [String] Friendly name of the User.
235
+ def friendly_name
236
+ @properties['friendly_name']
237
+ end
238
+
239
+ ##
240
+ # @return [Time] The date that this user was created, given in ISO 8601 format.
241
+ def created_date
242
+ @properties['created_date']
243
+ end
244
+
245
+ ##
246
+ # @return [Time] The date that this user was updated, given in ISO 8601 format.
247
+ def updated_date
248
+ @properties['updated_date']
249
+ end
250
+
251
+ ##
252
+ # @return [String] The current version of the user.
253
+ def version
254
+ @properties['version']
255
+ end
256
+
257
+ ##
258
+ # @return [String]
259
+ def url
260
+ @properties['url']
261
+ end
262
+
263
+ ##
264
+ # Fetch the FlexUserInstance
265
+ # @return [FlexUserInstance] Fetched FlexUserInstance
266
+ def fetch
267
+
268
+ context.fetch
269
+ end
270
+
271
+ ##
272
+ # Provide a user friendly representation
273
+ def to_s
274
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
275
+ "<Twilio.FlexApi.V2.FlexUserInstance #{values}>"
276
+ end
277
+
278
+ ##
279
+ # Provide a detailed, user friendly representation
280
+ def inspect
281
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
282
+ "<Twilio.FlexApi.V2.FlexUserInstance #{values}>"
283
+ end
284
+ end
285
+
286
+ end
287
+ end
288
+ end
289
+ end
@@ -36,12 +36,14 @@ module Twilio
36
36
  # @param [String] chat_friendly_name The Conversation's friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example.
37
37
  # @param [String] customer_friendly_name The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example.
38
38
  # @param [String] pre_engagement_data The pre-engagement data.
39
+ # @param [String] ui_version The Ui-Version HTTP request header
39
40
  # @return [WebChannelsInstance] Created WebChannelsInstance
40
41
  def create(
41
42
  address_sid: nil,
42
43
  chat_friendly_name: :unset,
43
44
  customer_friendly_name: :unset,
44
- pre_engagement_data: :unset
45
+ pre_engagement_data: :unset,
46
+ ui_version: :unset
45
47
  )
46
48
 
47
49
  data = Twilio::Values.of({
@@ -52,7 +54,8 @@ module Twilio
52
54
  })
53
55
 
54
56
 
55
- payload = @version.create('POST', @uri, data: data)
57
+ headers = Twilio::Values.of({ 'Ui-Version' => ui_version, })
58
+ payload = @version.create('POST', @uri, data: data, headers: headers)
56
59
  WebChannelsInstance.new(
57
60
  @version,
58
61
  payload,
@@ -21,9 +21,46 @@ module Twilio
21
21
  def initialize(domain)
22
22
  super
23
23
  @version = 'v2'
24
+ @flex_user = nil
24
25
  @web_channels = nil
25
26
  end
26
27
 
28
+ ##
29
+ # @param [String] instance_sid The unique ID created by Twilio to identify a Flex instance.
30
+ # @param [String] flex_user_sid The unique id for the flex user to be retrieved.
31
+ # @return [Twilio::REST::FlexApi::V2::FlexUserContext] if instanceSid was passed.
32
+ # @return [Twilio::REST::FlexApi::V2::FlexUserList]
33
+ def flex_user(instance_sid=:unset, flex_user_sid=:unset)
34
+ if instance_sid.nil?
35
+ raise ArgumentError, 'instance_sid cannot be nil'
36
+ end
37
+ if flex_user_sid.nil?
38
+ raise ArgumentError, 'flex_user_sid cannot be nil'
39
+ end
40
+ if instance_sid == :unset && flex_user_sid == :unset
41
+ @flex_user ||= FlexUserList.new self
42
+ else
43
+ FlexUserContext.new(self, instance_sid, flex_user_sid)
44
+ end
45
+ end
46
+ ##
47
+ # @param [String] instance_sid The unique ID created by Twilio to identify a Flex instance.
48
+ # @param [String] flex_user_sid The unique id for the flex user to be retrieved.
49
+ # @return [Twilio::REST::FlexApi::V2::FlexUserContext] if flexUserSid was passed.
50
+ # @return [Twilio::REST::FlexApi::V2::FlexUserList]
51
+ def flex_user(instance_sid=:unset, flex_user_sid=:unset)
52
+ if instance_sid.nil?
53
+ raise ArgumentError, 'instance_sid cannot be nil'
54
+ end
55
+ if flex_user_sid.nil?
56
+ raise ArgumentError, 'flex_user_sid cannot be nil'
57
+ end
58
+ if instance_sid == :unset && flex_user_sid == :unset
59
+ @flex_user ||= FlexUserList.new self
60
+ else
61
+ FlexUserContext.new(self, instance_sid, flex_user_sid)
62
+ end
63
+ end
27
64
  ##
28
65
  # @return [Twilio::REST::FlexApi::V2::WebChannelsList]
29
66
  def web_channels