twilio-ruby 5.56.0 → 5.58.1

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.travis.yml +24 -7
  4. data/CHANGES.md +76 -0
  5. data/Gemfile +1 -0
  6. data/README.md +2 -2
  7. data/examples/examples.rb +1 -1
  8. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +12 -3
  9. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +4 -1
  10. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  11. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  12. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  13. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
  14. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
  15. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
  16. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
  17. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
  18. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
  19. data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
  20. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
  21. data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
  22. data/lib/twilio-ruby/rest/conversations/v1.rb +7 -0
  23. data/lib/twilio-ruby/rest/conversations.rb +6 -0
  24. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
  25. data/lib/twilio-ruby/rest/insights/v1.rb +7 -0
  26. data/lib/twilio-ruby/rest/insights.rb +6 -0
  27. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +19 -1
  28. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
  29. data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
  30. data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
  31. data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
  32. data/lib/twilio-ruby/rest/pricing.rb +19 -0
  33. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
  34. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +26 -5
  35. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
  36. data/lib/twilio-ruby/version.rb +1 -1
  37. data/sonar-project.properties +13 -0
  38. metadata +10 -2
@@ -182,6 +182,9 @@ module Twilio
182
182
  # Path Solution
183
183
  @solution = {sid: sid, }
184
184
  @uri = "/Users/#{@solution[:sid]}"
185
+
186
+ # Dependents
187
+ @user_conversations = nil
185
188
  end
186
189
 
187
190
  ##
@@ -229,6 +232,24 @@ module Twilio
229
232
  UserInstance.new(@version, payload, sid: @solution[:sid], )
230
233
  end
231
234
 
235
+ ##
236
+ # Access the user_conversations
237
+ # @return [UserConversationList]
238
+ # @return [UserConversationContext] if conversation_sid was passed.
239
+ def user_conversations(conversation_sid=:unset)
240
+ raise ArgumentError, 'conversation_sid cannot be nil' if conversation_sid.nil?
241
+
242
+ if conversation_sid != :unset
243
+ return UserConversationContext.new(@version, @solution[:sid], conversation_sid, )
244
+ end
245
+
246
+ unless @user_conversations
247
+ @user_conversations = UserConversationList.new(@version, user_sid: @solution[:sid], )
248
+ end
249
+
250
+ @user_conversations
251
+ end
252
+
232
253
  ##
233
254
  # Provide a user friendly representation
234
255
  def to_s
@@ -269,6 +290,7 @@ module Twilio
269
290
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
270
291
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
271
292
  'url' => payload['url'],
293
+ 'links' => payload['links'],
272
294
  }
273
295
 
274
296
  # Context
@@ -359,6 +381,12 @@ module Twilio
359
381
  @properties['url']
360
382
  end
361
383
 
384
+ ##
385
+ # @return [String] The links
386
+ def links
387
+ @properties['links']
388
+ end
389
+
362
390
  ##
363
391
  # Update the UserInstance
364
392
  # @param [String] friendly_name The string that you assigned to describe the
@@ -396,6 +424,13 @@ module Twilio
396
424
  context.fetch
397
425
  end
398
426
 
427
+ ##
428
+ # Access the user_conversations
429
+ # @return [user_conversations] user_conversations
430
+ def user_conversations
431
+ context.user_conversations
432
+ end
433
+
399
434
  ##
400
435
  # Provide a user friendly representation
401
436
  def to_s
@@ -18,6 +18,7 @@ module Twilio
18
18
  @configuration = nil
19
19
  @conversations = nil
20
20
  @credentials = nil
21
+ @participant_conversations = nil
21
22
  @roles = nil
22
23
  @services = nil
23
24
  @users = nil
@@ -61,6 +62,12 @@ module Twilio
61
62
  end
62
63
  end
63
64
 
65
+ ##
66
+ # @return [Twilio::REST::Conversations::V1::ParticipantConversationContext]
67
+ def participant_conversations
68
+ @participant_conversations ||= ParticipantConversationList.new self
69
+ end
70
+
64
71
  ##
65
72
  # @param [String] sid The SID of the Role resource to fetch.
66
73
  # @return [Twilio::REST::Conversations::V1::RoleContext] if sid was passed.
@@ -52,6 +52,12 @@ module Twilio
52
52
  self.v1.credentials(sid)
53
53
  end
54
54
 
55
+ ##
56
+ # @return [Twilio::REST::Conversations::V1::ParticipantConversationInstance]
57
+ def participant_conversations
58
+ self.v1.participant_conversations()
59
+ end
60
+
55
61
  ##
56
62
  # @param [String] sid The unique string that we created to identify the Role
57
63
  # resource.
@@ -0,0 +1,434 @@
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 CallSummariesList < ListResource
14
+ ##
15
+ # Initialize the CallSummariesList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [CallSummariesList] CallSummariesList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Voice/Summaries"
24
+ end
25
+
26
+ ##
27
+ # Lists CallSummariesInstance records from the API as a list.
28
+ # Unlike stream(), this operation is eager and will load `limit` records into
29
+ # memory before returning.
30
+ # @param [Array[String]] from The from
31
+ # @param [Array[String]] to The to
32
+ # @param [Array[String]] from_carrier The from_carrier
33
+ # @param [Array[String]] to_carrier The to_carrier
34
+ # @param [Array[String]] from_country_code The from_country_code
35
+ # @param [Array[String]] to_country_code The to_country_code
36
+ # @param [Boolean] branded The branded
37
+ # @param [Boolean] verified_caller The verified_caller
38
+ # @param [Boolean] has_tag The has_tag
39
+ # @param [String] start_time The start_time
40
+ # @param [String] end_time The end_time
41
+ # @param [Array[String]] call_type The call_type
42
+ # @param [Array[String]] call_state The call_state
43
+ # @param [call_summaries.CallDirection] direction The direction
44
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
45
+ # processing_state
46
+ # @param [call_summaries.SortBy] sort_by The sort_by
47
+ # @param [String] subaccount The subaccount
48
+ # @param [Boolean] abnormal_session The abnormal_session
49
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
50
+ # guarantees to never return more than limit. Default is no limit
51
+ # @param [Integer] page_size Number of records to fetch per request, when
52
+ # not set will use the default value of 50 records. If no page_size is defined
53
+ # but a limit is defined, stream() will attempt to read the limit with the most
54
+ # efficient page size, i.e. min(limit, 1000)
55
+ # @return [Array] Array of up to limit results
56
+ def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, limit: nil, page_size: nil)
57
+ self.stream(
58
+ from: from,
59
+ to: to,
60
+ from_carrier: from_carrier,
61
+ to_carrier: to_carrier,
62
+ from_country_code: from_country_code,
63
+ to_country_code: to_country_code,
64
+ branded: branded,
65
+ verified_caller: verified_caller,
66
+ has_tag: has_tag,
67
+ start_time: start_time,
68
+ end_time: end_time,
69
+ call_type: call_type,
70
+ call_state: call_state,
71
+ direction: direction,
72
+ processing_state: processing_state,
73
+ sort_by: sort_by,
74
+ subaccount: subaccount,
75
+ abnormal_session: abnormal_session,
76
+ limit: limit,
77
+ page_size: page_size
78
+ ).entries
79
+ end
80
+
81
+ ##
82
+ # Streams CallSummariesInstance records from the API as an Enumerable.
83
+ # This operation lazily loads records as efficiently as possible until the limit
84
+ # is reached.
85
+ # @param [Array[String]] from The from
86
+ # @param [Array[String]] to The to
87
+ # @param [Array[String]] from_carrier The from_carrier
88
+ # @param [Array[String]] to_carrier The to_carrier
89
+ # @param [Array[String]] from_country_code The from_country_code
90
+ # @param [Array[String]] to_country_code The to_country_code
91
+ # @param [Boolean] branded The branded
92
+ # @param [Boolean] verified_caller The verified_caller
93
+ # @param [Boolean] has_tag The has_tag
94
+ # @param [String] start_time The start_time
95
+ # @param [String] end_time The end_time
96
+ # @param [Array[String]] call_type The call_type
97
+ # @param [Array[String]] call_state The call_state
98
+ # @param [call_summaries.CallDirection] direction The direction
99
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
100
+ # processing_state
101
+ # @param [call_summaries.SortBy] sort_by The sort_by
102
+ # @param [String] subaccount The subaccount
103
+ # @param [Boolean] abnormal_session The abnormal_session
104
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
105
+ # guarantees to never return more than limit. Default is no limit.
106
+ # @param [Integer] page_size Number of records to fetch per request, when
107
+ # not set will use the default value of 50 records. If no page_size is defined
108
+ # but a limit is defined, stream() will attempt to read the limit with the most
109
+ # efficient page size, i.e. min(limit, 1000)
110
+ # @return [Enumerable] Enumerable that will yield up to limit results
111
+ def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, limit: nil, page_size: nil)
112
+ limits = @version.read_limits(limit, page_size)
113
+
114
+ page = self.page(
115
+ from: from,
116
+ to: to,
117
+ from_carrier: from_carrier,
118
+ to_carrier: to_carrier,
119
+ from_country_code: from_country_code,
120
+ to_country_code: to_country_code,
121
+ branded: branded,
122
+ verified_caller: verified_caller,
123
+ has_tag: has_tag,
124
+ start_time: start_time,
125
+ end_time: end_time,
126
+ call_type: call_type,
127
+ call_state: call_state,
128
+ direction: direction,
129
+ processing_state: processing_state,
130
+ sort_by: sort_by,
131
+ subaccount: subaccount,
132
+ abnormal_session: abnormal_session,
133
+ page_size: limits[:page_size],
134
+ )
135
+
136
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
137
+ end
138
+
139
+ ##
140
+ # When passed a block, yields CallSummariesInstance records from the API.
141
+ # This operation lazily loads records as efficiently as possible until the limit
142
+ # is reached.
143
+ def each
144
+ limits = @version.read_limits
145
+
146
+ page = self.page(page_size: limits[:page_size], )
147
+
148
+ @version.stream(page,
149
+ limit: limits[:limit],
150
+ page_limit: limits[:page_limit]).each {|x| yield x}
151
+ end
152
+
153
+ ##
154
+ # Retrieve a single page of CallSummariesInstance records from the API.
155
+ # Request is executed immediately.
156
+ # @param [Array[String]] from The from
157
+ # @param [Array[String]] to The to
158
+ # @param [Array[String]] from_carrier The from_carrier
159
+ # @param [Array[String]] to_carrier The to_carrier
160
+ # @param [Array[String]] from_country_code The from_country_code
161
+ # @param [Array[String]] to_country_code The to_country_code
162
+ # @param [Boolean] branded The branded
163
+ # @param [Boolean] verified_caller The verified_caller
164
+ # @param [Boolean] has_tag The has_tag
165
+ # @param [String] start_time The start_time
166
+ # @param [String] end_time The end_time
167
+ # @param [Array[String]] call_type The call_type
168
+ # @param [Array[String]] call_state The call_state
169
+ # @param [call_summaries.CallDirection] direction The direction
170
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
171
+ # processing_state
172
+ # @param [call_summaries.SortBy] sort_by The sort_by
173
+ # @param [String] subaccount The subaccount
174
+ # @param [Boolean] abnormal_session The abnormal_session
175
+ # @param [String] page_token PageToken provided by the API
176
+ # @param [Integer] page_number Page Number, this value is simply for client state
177
+ # @param [Integer] page_size Number of records to return, defaults to 50
178
+ # @return [Page] Page of CallSummariesInstance
179
+ def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
180
+ params = Twilio::Values.of({
181
+ 'From' => Twilio.serialize_list(from) { |e| e },
182
+ 'To' => Twilio.serialize_list(to) { |e| e },
183
+ 'FromCarrier' => Twilio.serialize_list(from_carrier) { |e| e },
184
+ 'ToCarrier' => Twilio.serialize_list(to_carrier) { |e| e },
185
+ 'FromCountryCode' => Twilio.serialize_list(from_country_code) { |e| e },
186
+ 'ToCountryCode' => Twilio.serialize_list(to_country_code) { |e| e },
187
+ 'Branded' => branded,
188
+ 'VerifiedCaller' => verified_caller,
189
+ 'HasTag' => has_tag,
190
+ 'StartTime' => start_time,
191
+ 'EndTime' => end_time,
192
+ 'CallType' => Twilio.serialize_list(call_type) { |e| e },
193
+ 'CallState' => Twilio.serialize_list(call_state) { |e| e },
194
+ 'Direction' => direction,
195
+ 'ProcessingState' => processing_state,
196
+ 'SortBy' => sort_by,
197
+ 'Subaccount' => subaccount,
198
+ 'AbnormalSession' => abnormal_session,
199
+ 'PageToken' => page_token,
200
+ 'Page' => page_number,
201
+ 'PageSize' => page_size,
202
+ })
203
+
204
+ response = @version.page('GET', @uri, params: params)
205
+
206
+ CallSummariesPage.new(@version, response, @solution)
207
+ end
208
+
209
+ ##
210
+ # Retrieve a single page of CallSummariesInstance records from the API.
211
+ # Request is executed immediately.
212
+ # @param [String] target_url API-generated URL for the requested results page
213
+ # @return [Page] Page of CallSummariesInstance
214
+ def get_page(target_url)
215
+ response = @version.domain.request(
216
+ 'GET',
217
+ target_url
218
+ )
219
+ CallSummariesPage.new(@version, response, @solution)
220
+ end
221
+
222
+ ##
223
+ # Provide a user friendly representation
224
+ def to_s
225
+ '#<Twilio.Insights.V1.CallSummariesList>'
226
+ end
227
+ end
228
+
229
+ class CallSummariesPage < Page
230
+ ##
231
+ # Initialize the CallSummariesPage
232
+ # @param [Version] version Version that contains the resource
233
+ # @param [Response] response Response from the API
234
+ # @param [Hash] solution Path solution for the resource
235
+ # @return [CallSummariesPage] CallSummariesPage
236
+ def initialize(version, response, solution)
237
+ super(version, response)
238
+
239
+ # Path Solution
240
+ @solution = solution
241
+ end
242
+
243
+ ##
244
+ # Build an instance of CallSummariesInstance
245
+ # @param [Hash] payload Payload response from the API
246
+ # @return [CallSummariesInstance] CallSummariesInstance
247
+ def get_instance(payload)
248
+ CallSummariesInstance.new(@version, payload, )
249
+ end
250
+
251
+ ##
252
+ # Provide a user friendly representation
253
+ def to_s
254
+ '<Twilio.Insights.V1.CallSummariesPage>'
255
+ end
256
+ end
257
+
258
+ class CallSummariesInstance < InstanceResource
259
+ ##
260
+ # Initialize the CallSummariesInstance
261
+ # @param [Version] version Version that contains the resource
262
+ # @param [Hash] payload payload that contains response from Twilio
263
+ # @return [CallSummariesInstance] CallSummariesInstance
264
+ def initialize(version, payload)
265
+ super(version)
266
+
267
+ # Marshaled Properties
268
+ @properties = {
269
+ 'account_sid' => payload['account_sid'],
270
+ 'call_sid' => payload['call_sid'],
271
+ 'call_type' => payload['call_type'],
272
+ 'call_state' => payload['call_state'],
273
+ 'processing_state' => payload['processing_state'],
274
+ 'created_time' => Twilio.deserialize_iso8601_datetime(payload['created_time']),
275
+ 'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']),
276
+ 'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
277
+ 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
278
+ 'connect_duration' => payload['connect_duration'] == nil ? payload['connect_duration'] : payload['connect_duration'].to_i,
279
+ 'from' => payload['from'],
280
+ 'to' => payload['to'],
281
+ 'carrier_edge' => payload['carrier_edge'],
282
+ 'client_edge' => payload['client_edge'],
283
+ 'sdk_edge' => payload['sdk_edge'],
284
+ 'sip_edge' => payload['sip_edge'],
285
+ 'tags' => payload['tags'],
286
+ 'url' => payload['url'],
287
+ 'attributes' => payload['attributes'],
288
+ 'properties' => payload['properties'],
289
+ 'trust' => payload['trust'],
290
+ }
291
+ end
292
+
293
+ ##
294
+ # @return [String] The account_sid
295
+ def account_sid
296
+ @properties['account_sid']
297
+ end
298
+
299
+ ##
300
+ # @return [String] The call_sid
301
+ def call_sid
302
+ @properties['call_sid']
303
+ end
304
+
305
+ ##
306
+ # @return [call_summaries.CallType] The call_type
307
+ def call_type
308
+ @properties['call_type']
309
+ end
310
+
311
+ ##
312
+ # @return [call_summaries.CallState] The call_state
313
+ def call_state
314
+ @properties['call_state']
315
+ end
316
+
317
+ ##
318
+ # @return [call_summaries.ProcessingState] The processing_state
319
+ def processing_state
320
+ @properties['processing_state']
321
+ end
322
+
323
+ ##
324
+ # @return [Time] The created_time
325
+ def created_time
326
+ @properties['created_time']
327
+ end
328
+
329
+ ##
330
+ # @return [Time] The start_time
331
+ def start_time
332
+ @properties['start_time']
333
+ end
334
+
335
+ ##
336
+ # @return [Time] The end_time
337
+ def end_time
338
+ @properties['end_time']
339
+ end
340
+
341
+ ##
342
+ # @return [String] The duration
343
+ def duration
344
+ @properties['duration']
345
+ end
346
+
347
+ ##
348
+ # @return [String] The connect_duration
349
+ def connect_duration
350
+ @properties['connect_duration']
351
+ end
352
+
353
+ ##
354
+ # @return [Hash] The from
355
+ def from
356
+ @properties['from']
357
+ end
358
+
359
+ ##
360
+ # @return [Hash] The to
361
+ def to
362
+ @properties['to']
363
+ end
364
+
365
+ ##
366
+ # @return [Hash] The carrier_edge
367
+ def carrier_edge
368
+ @properties['carrier_edge']
369
+ end
370
+
371
+ ##
372
+ # @return [Hash] The client_edge
373
+ def client_edge
374
+ @properties['client_edge']
375
+ end
376
+
377
+ ##
378
+ # @return [Hash] The sdk_edge
379
+ def sdk_edge
380
+ @properties['sdk_edge']
381
+ end
382
+
383
+ ##
384
+ # @return [Hash] The sip_edge
385
+ def sip_edge
386
+ @properties['sip_edge']
387
+ end
388
+
389
+ ##
390
+ # @return [Array[String]] The tags
391
+ def tags
392
+ @properties['tags']
393
+ end
394
+
395
+ ##
396
+ # @return [String] The url
397
+ def url
398
+ @properties['url']
399
+ end
400
+
401
+ ##
402
+ # @return [Hash] The attributes
403
+ def attributes
404
+ @properties['attributes']
405
+ end
406
+
407
+ ##
408
+ # @return [Hash] The properties
409
+ def properties
410
+ @properties['properties']
411
+ end
412
+
413
+ ##
414
+ # @return [Hash] The trust
415
+ def trust
416
+ @properties['trust']
417
+ end
418
+
419
+ ##
420
+ # Provide a user friendly representation
421
+ def to_s
422
+ "<Twilio.Insights.V1.CallSummariesInstance>"
423
+ end
424
+
425
+ ##
426
+ # Provide a detailed, user friendly representation
427
+ def inspect
428
+ "<Twilio.Insights.V1.CallSummariesInstance>"
429
+ end
430
+ end
431
+ end
432
+ end
433
+ end
434
+ end