twilio-ruby 7.2.2 → 7.2.4

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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +48 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +5 -599
  5. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +2 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb +200 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +22 -1
  8. data/lib/twilio-ruby/rest/client.rb +0 -5
  9. data/lib/twilio-ruby/rest/content/v1/content.rb +67 -1
  10. data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +81 -1
  11. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +60 -12
  12. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +1 -1
  13. data/lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb +16 -3
  14. data/lib/twilio-ruby/rest/intelligence/v2.rb +1 -1
  15. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +8 -8
  16. data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +22 -9
  17. data/lib/twilio-ruby/rest/marketplace/v1/referral_conversion.rb +199 -0
  18. data/lib/twilio-ruby/rest/marketplace/v1.rb +7 -1
  19. data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +4 -1
  20. data/lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb +40 -0
  21. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +8 -8
  22. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +24 -17
  23. data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +7 -7
  24. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +3 -3
  25. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +1 -1
  26. data/lib/twilio-ruby/rest/numbers/v1/{webhook.rb → porting_webhook_configuration_fetch.rb} +23 -23
  27. data/lib/twilio-ruby/rest/numbers/v1/signing_request_configuration.rb +96 -0
  28. data/lib/twilio-ruby/rest/numbers/v1.rb +8 -8
  29. data/lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb +277 -0
  30. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +4 -1
  31. data/lib/twilio-ruby/rest/numbers/v2.rb +15 -0
  32. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +2 -2
  33. data/lib/twilio-ruby/rest/trusthub/v1/compliance_inquiries.rb +12 -3
  34. data/lib/twilio-ruby/rest/verify/v2/service.rb +4 -4
  35. data/lib/twilio-ruby/version.rb +1 -1
  36. data/twilio-ruby.gemspec +2 -1
  37. metadata +7 -5
  38. data/lib/twilio-ruby/rest/preview_iam.rb +0 -6
  39. data/lib/twilio-ruby/rest/preview_iam_base.rb +0 -33
@@ -0,0 +1,200 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Api
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 Api < ApiBase
19
+ class V2010 < Version
20
+ class AccountContext < InstanceContext
21
+ class RecordingContext < InstanceContext
22
+ class AddOnResultContext < InstanceContext
23
+ class PayloadContext < InstanceContext
24
+
25
+ class DataList < ListResource
26
+
27
+ ##
28
+ # Initialize the DataList
29
+ # @param [Version] version Version that contains the resource
30
+ # @return [DataList] DataList
31
+ def initialize(version, account_sid: nil, reference_sid: nil, add_on_result_sid: nil, payload_sid: nil)
32
+ super(version)
33
+ # Path Solution
34
+ @solution = { account_sid: account_sid, reference_sid: reference_sid, add_on_result_sid: add_on_result_sid, payload_sid: payload_sid }
35
+
36
+
37
+ end
38
+
39
+
40
+
41
+ # Provide a user friendly representation
42
+ def to_s
43
+ '#<Twilio.Api.V2010.DataList>'
44
+ end
45
+ end
46
+
47
+
48
+ class DataContext < InstanceContext
49
+ ##
50
+ # Initialize the DataContext
51
+ # @param [Version] version Version that contains the resource
52
+ # @param [String] account_sid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resource to fetch.
53
+ # @param [String] reference_sid The SID of the recording to which the AddOnResult resource that contains the payload to fetch belongs.
54
+ # @param [String] add_on_result_sid The SID of the AddOnResult to which the payload to fetch belongs.
55
+ # @param [String] payload_sid The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to fetch.
56
+ # @return [DataContext] DataContext
57
+ def initialize(version, account_sid, reference_sid, add_on_result_sid, payload_sid)
58
+ super(version)
59
+
60
+ # Path Solution
61
+ @solution = { account_sid: account_sid, reference_sid: reference_sid, add_on_result_sid: add_on_result_sid, payload_sid: payload_sid, }
62
+ @uri = "/Accounts/#{@solution[:account_sid]}/Recordings/#{@solution[:reference_sid]}/AddOnResults/#{@solution[:add_on_result_sid]}/Payloads/#{@solution[:payload_sid]}/Data.json"
63
+
64
+
65
+ end
66
+ ##
67
+ # Fetch the DataInstance
68
+ # @return [DataInstance] Fetched DataInstance
69
+ def fetch
70
+
71
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
72
+
73
+ payload = @version.fetch('GET', @uri, headers: headers)
74
+ DataInstance.new(
75
+ @version,
76
+ payload,
77
+ account_sid: @solution[:account_sid],
78
+ reference_sid: @solution[:reference_sid],
79
+ add_on_result_sid: @solution[:add_on_result_sid],
80
+ payload_sid: @solution[:payload_sid],
81
+ )
82
+ end
83
+
84
+
85
+ ##
86
+ # Provide a user friendly representation
87
+ def to_s
88
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
89
+ "#<Twilio.Api.V2010.DataContext #{context}>"
90
+ end
91
+
92
+ ##
93
+ # Provide a detailed, user friendly representation
94
+ def inspect
95
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
96
+ "#<Twilio.Api.V2010.DataContext #{context}>"
97
+ end
98
+ end
99
+
100
+ class DataPage < Page
101
+ ##
102
+ # Initialize the DataPage
103
+ # @param [Version] version Version that contains the resource
104
+ # @param [Response] response Response from the API
105
+ # @param [Hash] solution Path solution for the resource
106
+ # @return [DataPage] DataPage
107
+ def initialize(version, response, solution)
108
+ super(version, response)
109
+
110
+ # Path Solution
111
+ @solution = solution
112
+ end
113
+
114
+ ##
115
+ # Build an instance of DataInstance
116
+ # @param [Hash] payload Payload response from the API
117
+ # @return [DataInstance] DataInstance
118
+ def get_instance(payload)
119
+ DataInstance.new(@version, payload, account_sid: @solution[:account_sid], reference_sid: @solution[:reference_sid], add_on_result_sid: @solution[:add_on_result_sid], payload_sid: @solution[:payload_sid])
120
+ end
121
+
122
+ ##
123
+ # Provide a user friendly representation
124
+ def to_s
125
+ '<Twilio.Api.V2010.DataPage>'
126
+ end
127
+ end
128
+ class DataInstance < InstanceResource
129
+ ##
130
+ # Initialize the DataInstance
131
+ # @param [Version] version Version that contains the resource
132
+ # @param [Hash] payload payload that contains response from Twilio
133
+ # @param [String] account_sid The SID of the
134
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Data
135
+ # resource.
136
+ # @param [String] sid The SID of the Call resource to fetch.
137
+ # @return [DataInstance] DataInstance
138
+ def initialize(version, payload , account_sid: nil, reference_sid: nil, add_on_result_sid: nil, payload_sid: nil)
139
+ super(version)
140
+
141
+ # Marshaled Properties
142
+ @properties = {
143
+ 'redirect_to' => payload['redirect_to'],
144
+ }
145
+
146
+ # Context
147
+ @instance_context = nil
148
+ @params = { 'account_sid' => account_sid ,'reference_sid' => reference_sid || @properties['reference_sid'] ,'add_on_result_sid' => add_on_result_sid || @properties['add_on_result_sid'] ,'payload_sid' => payload_sid || @properties['payload_sid'] , }
149
+ end
150
+
151
+ ##
152
+ # Generate an instance context for the instance, the context is capable of
153
+ # performing various actions. All instance actions are proxied to the context
154
+ # @return [DataContext] CallContext for this CallInstance
155
+ def context
156
+ unless @instance_context
157
+ @instance_context = DataContext.new(@version , @params['account_sid'], @params['reference_sid'], @params['add_on_result_sid'], @params['payload_sid'])
158
+ end
159
+ @instance_context
160
+ end
161
+
162
+ ##
163
+ # @return [String] The URL to redirect to to get the data returned by the AddOn that was previously stored.
164
+ def redirect_to
165
+ @properties['redirect_to']
166
+ end
167
+
168
+ ##
169
+ # Fetch the DataInstance
170
+ # @return [DataInstance] Fetched DataInstance
171
+ def fetch
172
+
173
+ context.fetch
174
+ end
175
+
176
+ ##
177
+ # Provide a user friendly representation
178
+ def to_s
179
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
180
+ "<Twilio.Api.V2010.DataInstance #{values}>"
181
+ end
182
+
183
+ ##
184
+ # Provide a detailed, user friendly representation
185
+ def inspect
186
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
187
+ "<Twilio.Api.V2010.DataInstance #{values}>"
188
+ end
189
+ end
190
+
191
+ end
192
+ end
193
+ end
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
199
+
200
+
@@ -144,7 +144,8 @@ module Twilio
144
144
  @solution = { account_sid: account_sid, reference_sid: reference_sid, add_on_result_sid: add_on_result_sid, sid: sid, }
145
145
  @uri = "/Accounts/#{@solution[:account_sid]}/Recordings/#{@solution[:reference_sid]}/AddOnResults/#{@solution[:add_on_result_sid]}/Payloads/#{@solution[:sid]}.json"
146
146
 
147
-
147
+ # Dependents
148
+ @data = nil
148
149
  end
149
150
  ##
150
151
  # Delete the PayloadInstance
@@ -174,6 +175,19 @@ module Twilio
174
175
  )
175
176
  end
176
177
 
178
+ ##
179
+ # Access the data
180
+ # @return [DataList]
181
+ # @return [DataContext]
182
+ def data
183
+ DataContext.new(
184
+ @version,
185
+ @solution[:account_sid],
186
+ @solution[:reference_sid],
187
+ @solution[:add_on_result_sid],
188
+ @solution[:sid]
189
+ )
190
+ end
177
191
 
178
192
  ##
179
193
  # Provide a user friendly representation
@@ -344,6 +358,13 @@ module Twilio
344
358
  context.fetch
345
359
  end
346
360
 
361
+ ##
362
+ # Access the data
363
+ # @return [data] data
364
+ def data
365
+ context.data
366
+ end
367
+
347
368
  ##
348
369
  # Provide a user friendly representation
349
370
  def to_s
@@ -62,11 +62,6 @@ module Twilio
62
62
  @frontline_api ||= FrontlineApi.new self
63
63
  end
64
64
  ##
65
- # Access the PreviewIam Twilio Domain
66
- def preview_iam
67
- @preview_iam ||= PreviewIam.new self
68
- end
69
- ##
70
65
  # Access the Insights Twilio Domain
71
66
  def insights
72
67
  @insights ||= Insights.new self
@@ -85,6 +85,53 @@ module Twilio
85
85
  end
86
86
  end
87
87
 
88
+ class CarouselAction
89
+ # @param [type]: [CarouselActionType]
90
+ # @param [title]: [String]
91
+ # @param [url]: [String]
92
+ # @param [phone]: [String]
93
+ # @param [id]: [String]
94
+ attr_accessor :type, :title, :url, :phone, :id
95
+ def initialize(payload)
96
+ @type = payload["type"]
97
+ @title = payload["title"]
98
+ @url = payload["url"]
99
+ @phone = payload["phone"]
100
+ @id = payload["id"]
101
+ end
102
+ def to_json(options = {})
103
+ {
104
+ type: @type,
105
+ title: @title,
106
+ url: @url,
107
+ phone: @phone,
108
+ id: @id,
109
+ }.to_json(options)
110
+ end
111
+ end
112
+
113
+ class CarouselCard
114
+ # @param [title]: [String]
115
+ # @param [body]: [String]
116
+ # @param [media]: [String]
117
+ # @param [actions]: [Array<ContentList.CarouselAction>]
118
+ attr_accessor :title, :body, :media, :actions
119
+ def initialize(payload)
120
+ @title = payload["title"]
121
+ @body = payload["body"]
122
+ @media = payload["media"]
123
+ @actions = payload["actions"]
124
+ end
125
+ def to_json(options = {})
126
+ {
127
+ title: @title,
128
+ body: @body,
129
+ media: @media,
130
+ actions: @actions,
131
+ }.to_json(options)
132
+ end
133
+ end
134
+
88
135
  class CatalogItem
89
136
  # @param [id]: [String]
90
137
  # @param [section_title]: [String]
@@ -211,6 +258,22 @@ module Twilio
211
258
  end
212
259
  end
213
260
 
261
+ class TwilioCarousel
262
+ # @param [body]: [String]
263
+ # @param [cards]: [Array<ContentList.CarouselCard>]
264
+ attr_accessor :body, :cards
265
+ def initialize(payload)
266
+ @body = payload["body"]
267
+ @cards = payload["cards"]
268
+ end
269
+ def to_json(options = {})
270
+ {
271
+ body: @body,
272
+ cards: @cards,
273
+ }.to_json(options)
274
+ end
275
+ end
276
+
214
277
  class TwilioCatalog
215
278
  # @param [title]: [String]
216
279
  # @param [body]: [String]
@@ -331,9 +394,10 @@ module Twilio
331
394
  # @param [twilio_quick_reply]: [ContentList.TwilioQuickReply]
332
395
  # @param [twilio_card]: [ContentList.TwilioCard]
333
396
  # @param [twilio_catalog]: [ContentList.TwilioCatalog]
397
+ # @param [twilio_carousel]: [ContentList.TwilioCarousel]
334
398
  # @param [whatsapp_card]: [ContentList.WhatsappCard]
335
399
  # @param [whatsapp_authentication]: [ContentList.WhatsappAuthentication]
336
- attr_accessor :twilio_text, :twilio_media, :twilio_location, :twilio_list_picker, :twilio_call_to_action, :twilio_quick_reply, :twilio_card, :twilio_catalog, :whatsapp_card, :whatsapp_authentication
400
+ attr_accessor :twilio_text, :twilio_media, :twilio_location, :twilio_list_picker, :twilio_call_to_action, :twilio_quick_reply, :twilio_card, :twilio_catalog, :twilio_carousel, :whatsapp_card, :whatsapp_authentication
337
401
  def initialize(payload)
338
402
  @twilio_text = payload["twilio_text"]
339
403
  @twilio_media = payload["twilio_media"]
@@ -343,6 +407,7 @@ module Twilio
343
407
  @twilio_quick_reply = payload["twilio_quick_reply"]
344
408
  @twilio_card = payload["twilio_card"]
345
409
  @twilio_catalog = payload["twilio_catalog"]
410
+ @twilio_carousel = payload["twilio_carousel"]
346
411
  @whatsapp_card = payload["whatsapp_card"]
347
412
  @whatsapp_authentication = payload["whatsapp_authentication"]
348
413
  end
@@ -356,6 +421,7 @@ module Twilio
356
421
  twilio_quick_reply: @twilio_quick_reply,
357
422
  twilio_card: @twilio_card,
358
423
  twilio_catalog: @twilio_catalog,
424
+ twilio_carousel: @twilio_carousel,
359
425
  whatsapp_card: @whatsapp_card,
360
426
  whatsapp_authentication: @whatsapp_authentication,
361
427
  }.to_json(options)
@@ -45,7 +45,7 @@ module Twilio
45
45
  # Initialize the FlexUserContext
46
46
  # @param [Version] version Version that contains the resource
47
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.
48
+ # @param [String] flex_user_sid The unique id for the flex user.
49
49
  # @return [FlexUserContext] FlexUserContext
50
50
  def initialize(version, instance_sid, flex_user_sid)
51
51
  super(version)
@@ -72,6 +72,44 @@ module Twilio
72
72
  )
73
73
  end
74
74
 
75
+ ##
76
+ # Update the FlexUserInstance
77
+ # @param [String] first_name First name of the User.
78
+ # @param [String] last_name Last name of the User.
79
+ # @param [String] email Email of the User.
80
+ # @param [String] friendly_name Friendly name of the User.
81
+ # @param [String] user_sid The unique SID identifier of the Twilio Unified User.
82
+ # @param [String] locale The locale preference of the user.
83
+ # @return [FlexUserInstance] Updated FlexUserInstance
84
+ def update(
85
+ first_name: :unset,
86
+ last_name: :unset,
87
+ email: :unset,
88
+ friendly_name: :unset,
89
+ user_sid: :unset,
90
+ locale: :unset
91
+ )
92
+
93
+ data = Twilio::Values.of({
94
+ 'FirstName' => first_name,
95
+ 'LastName' => last_name,
96
+ 'Email' => email,
97
+ 'FriendlyName' => friendly_name,
98
+ 'UserSid' => user_sid,
99
+ 'Locale' => locale,
100
+ })
101
+
102
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
103
+
104
+ payload = @version.update('POST', @uri, data: data, headers: headers)
105
+ FlexUserInstance.new(
106
+ @version,
107
+ payload,
108
+ instance_sid: @solution[:instance_sid],
109
+ flex_user_sid: @solution[:flex_user_sid],
110
+ )
111
+ end
112
+
75
113
 
76
114
  ##
77
115
  # Provide a user friendly representation
@@ -143,6 +181,8 @@ module Twilio
143
181
  'username' => payload['username'],
144
182
  'email' => payload['email'],
145
183
  'friendly_name' => payload['friendly_name'],
184
+ 'locale' => payload['locale'],
185
+ 'roles' => payload['roles'],
146
186
  'created_date' => Twilio.deserialize_iso8601_datetime(payload['created_date']),
147
187
  'updated_date' => Twilio.deserialize_iso8601_datetime(payload['updated_date']),
148
188
  'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i,
@@ -237,6 +277,18 @@ module Twilio
237
277
  @properties['friendly_name']
238
278
  end
239
279
 
280
+ ##
281
+ # @return [String] The locale preference of the user.
282
+ def locale
283
+ @properties['locale']
284
+ end
285
+
286
+ ##
287
+ # @return [Array<String>] The roles of the user.
288
+ def roles
289
+ @properties['roles']
290
+ end
291
+
240
292
  ##
241
293
  # @return [Time] The date that this user was created, given in ISO 8601 format.
242
294
  def created_date
@@ -269,6 +321,34 @@ module Twilio
269
321
  context.fetch
270
322
  end
271
323
 
324
+ ##
325
+ # Update the FlexUserInstance
326
+ # @param [String] first_name First name of the User.
327
+ # @param [String] last_name Last name of the User.
328
+ # @param [String] email Email of the User.
329
+ # @param [String] friendly_name Friendly name of the User.
330
+ # @param [String] user_sid The unique SID identifier of the Twilio Unified User.
331
+ # @param [String] locale The locale preference of the user.
332
+ # @return [FlexUserInstance] Updated FlexUserInstance
333
+ def update(
334
+ first_name: :unset,
335
+ last_name: :unset,
336
+ email: :unset,
337
+ friendly_name: :unset,
338
+ user_sid: :unset,
339
+ locale: :unset
340
+ )
341
+
342
+ context.update(
343
+ first_name: first_name,
344
+ last_name: last_name,
345
+ email: email,
346
+ friendly_name: friendly_name,
347
+ user_sid: user_sid,
348
+ locale: locale,
349
+ )
350
+ end
351
+
272
352
  ##
273
353
  # Provide a user friendly representation
274
354
  def to_s