twilio-ruby 7.11.2 → 7.11.3

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.
@@ -19,6 +19,19 @@ module Twilio
19
19
  class V2 < Version
20
20
  class ConversationList < ListResource
21
21
 
22
+ class ConversationWorkflow
23
+ # @param [flow_id]: [String] The Studio Flow to run.
24
+ attr_accessor :flow_id
25
+ def initialize(payload)
26
+ @flow_id = payload["flow_id"]
27
+ end
28
+ def to_json(options = {})
29
+ {
30
+ "flowId": @flow_id,
31
+ }.to_json(options)
32
+ end
33
+ end
34
+
22
35
  class ConversationsV2Address
23
36
  # @param [channel]: [ConversationsV2Channel]
24
37
  # @param [address]: [String] The address value formatted according to channel type: - SMS/VOICE: E.164 phone number (such as \"+18005550100\") - WHATSAPP: Phone number with whatsapp prefix (such as \"whatsapp:+18005550100\") - RCS: Sender ID or phone number with rcs prefix (such as \"rcs:brand_acme_agent\" or \"rcs:+18005550100\") - CHAT: Customer-defined string identifier
@@ -78,12 +91,14 @@ module Twilio
78
91
  # @param [name]: [String] The name of the conversation.
79
92
  # @param [configuration]: [ConversationList.CreateConversationWithConfigRequestConfiguration]
80
93
  # @param [participants]: [Array<ConversationList.CreateConversationWithConfigRequestParticipants>] Optional list of Participants to create with the Conversation.
81
- attr_accessor :configuration_id, :name, :configuration, :participants
94
+ # @param [metadata]: [Hash<String, String>] Optional customer-managed key-value metadata for this Conversation. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters.
95
+ attr_accessor :configuration_id, :name, :configuration, :participants, :metadata
82
96
  def initialize(payload)
83
97
  @configuration_id = payload["configuration_id"]
84
98
  @name = payload["name"]
85
99
  @configuration = payload["configuration"]
86
100
  @participants = payload["participants"]
101
+ @metadata = payload["metadata"]
87
102
  end
88
103
  def to_json(options = {})
89
104
  {
@@ -91,19 +106,23 @@ module Twilio
91
106
  "name": @name,
92
107
  "configuration": @configuration,
93
108
  "participants": @participants,
109
+ "metadata": @metadata,
94
110
  }.to_json(options)
95
111
  end
96
112
  end
97
113
 
98
114
  class CreateConversationWithConfigRequestConfiguration
99
115
  # @param [intelligence_configuration_ids]: [Array<String>] A list of Conversational Intelligence configuration IDs.
100
- attr_accessor :intelligence_configuration_ids
116
+ # @param [workflows]: [Array<ConversationList.ConversationWorkflow>] The Workflows to associate with this Conversation. Overrides the Configuration's own.
117
+ attr_accessor :intelligence_configuration_ids, :workflows
101
118
  def initialize(payload)
102
119
  @intelligence_configuration_ids = payload["intelligence_configuration_ids"]
120
+ @workflows = payload["workflows"]
103
121
  end
104
122
  def to_json(options = {})
105
123
  {
106
124
  "intelligenceConfigurationIds": @intelligence_configuration_ids,
125
+ "workflows": @workflows,
107
126
  }.to_json(options)
108
127
  end
109
128
  end
@@ -153,17 +172,20 @@ module Twilio
153
172
  # @param [name]: [String] The name of the Conversation.
154
173
  # @param [status]: [String] Lifecycle status of a Conversation.
155
174
  # @param [configuration]: [ConversationList.PatchConversationByIdRequestConfiguration]
156
- attr_accessor :name, :status, :configuration
175
+ # @param [metadata]: [Hash<String, String>] Merge patch for customer-managed metadata (max 8 entries after merge). Provided keys are added or updated; keys set to null are removed; keys not mentioned are preserved.
176
+ attr_accessor :name, :status, :configuration, :metadata
157
177
  def initialize(payload)
158
178
  @name = payload["name"]
159
179
  @status = payload["status"]
160
180
  @configuration = payload["configuration"]
181
+ @metadata = payload["metadata"]
161
182
  end
162
183
  def to_json(options = {})
163
184
  {
164
185
  "name": @name,
165
186
  "status": @status,
166
187
  "configuration": @configuration,
188
+ "metadata": @metadata,
167
189
  }.to_json(options)
168
190
  end
169
191
  end
@@ -184,20 +206,36 @@ module Twilio
184
206
  class UpdateConversationByIdRequest
185
207
  # @param [name]: [String] The name of the Conversation.
186
208
  # @param [status]: [String] Lifecycle status of a Conversation.
187
- attr_accessor :name, :status
209
+ # @param [metadata]: [Hash<String, String>] Customer-managed key-value metadata for this Conversation. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters.
210
+ attr_accessor :name, :status, :metadata
188
211
  def initialize(payload)
189
212
  @name = payload["name"]
190
213
  @status = payload["status"]
214
+ @metadata = payload["metadata"]
191
215
  end
192
216
  def to_json(options = {})
193
217
  {
194
218
  "name": @name,
195
219
  "status": @status,
220
+ "metadata": @metadata,
196
221
  }.to_json(options)
197
222
  end
198
223
  end
199
224
 
200
225
 
226
+ class ConversationWorkflow
227
+ # @param [flow_id]: [String] The Studio Flow to run.
228
+ attr_accessor :flow_id
229
+ def initialize(payload)
230
+ @flow_id = payload["flow_id"]
231
+ end
232
+ def to_json(options = {})
233
+ {
234
+ "flowId": @flow_id,
235
+ }.to_json(options)
236
+ end
237
+ end
238
+
201
239
  class ConversationsV2Address
202
240
  # @param [channel]: [ConversationsV2Channel]
203
241
  # @param [address]: [String] The address value formatted according to channel type: - SMS/VOICE: E.164 phone number (such as \"+18005550100\") - WHATSAPP: Phone number with whatsapp prefix (such as \"whatsapp:+18005550100\") - RCS: Sender ID or phone number with rcs prefix (such as \"rcs:brand_acme_agent\" or \"rcs:+18005550100\") - CHAT: Customer-defined string identifier
@@ -257,12 +295,14 @@ module Twilio
257
295
  # @param [name]: [String] The name of the conversation.
258
296
  # @param [configuration]: [ConversationList.CreateConversationWithConfigRequestConfiguration]
259
297
  # @param [participants]: [Array<ConversationList.CreateConversationWithConfigRequestParticipants>] Optional list of Participants to create with the Conversation.
260
- attr_accessor :configuration_id, :name, :configuration, :participants
298
+ # @param [metadata]: [Hash<String, String>] Optional customer-managed key-value metadata for this Conversation. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters.
299
+ attr_accessor :configuration_id, :name, :configuration, :participants, :metadata
261
300
  def initialize(payload)
262
301
  @configuration_id = payload["configuration_id"]
263
302
  @name = payload["name"]
264
303
  @configuration = payload["configuration"]
265
304
  @participants = payload["participants"]
305
+ @metadata = payload["metadata"]
266
306
  end
267
307
  def to_json(options = {})
268
308
  {
@@ -270,19 +310,23 @@ module Twilio
270
310
  "name": @name,
271
311
  "configuration": @configuration,
272
312
  "participants": @participants,
313
+ "metadata": @metadata,
273
314
  }.to_json(options)
274
315
  end
275
316
  end
276
317
 
277
318
  class CreateConversationWithConfigRequestConfiguration
278
319
  # @param [intelligence_configuration_ids]: [Array<String>] A list of Conversational Intelligence configuration IDs.
279
- attr_accessor :intelligence_configuration_ids
320
+ # @param [workflows]: [Array<ConversationList.ConversationWorkflow>] The Workflows to associate with this Conversation. Overrides the Configuration's own.
321
+ attr_accessor :intelligence_configuration_ids, :workflows
280
322
  def initialize(payload)
281
323
  @intelligence_configuration_ids = payload["intelligence_configuration_ids"]
324
+ @workflows = payload["workflows"]
282
325
  end
283
326
  def to_json(options = {})
284
327
  {
285
328
  "intelligenceConfigurationIds": @intelligence_configuration_ids,
329
+ "workflows": @workflows,
286
330
  }.to_json(options)
287
331
  end
288
332
  end
@@ -332,17 +376,20 @@ module Twilio
332
376
  # @param [name]: [String] The name of the Conversation.
333
377
  # @param [status]: [String] Lifecycle status of a Conversation.
334
378
  # @param [configuration]: [ConversationList.PatchConversationByIdRequestConfiguration]
335
- attr_accessor :name, :status, :configuration
379
+ # @param [metadata]: [Hash<String, String>] Merge patch for customer-managed metadata (max 8 entries after merge). Provided keys are added or updated; keys set to null are removed; keys not mentioned are preserved.
380
+ attr_accessor :name, :status, :configuration, :metadata
336
381
  def initialize(payload)
337
382
  @name = payload["name"]
338
383
  @status = payload["status"]
339
384
  @configuration = payload["configuration"]
385
+ @metadata = payload["metadata"]
340
386
  end
341
387
  def to_json(options = {})
342
388
  {
343
389
  "name": @name,
344
390
  "status": @status,
345
391
  "configuration": @configuration,
392
+ "metadata": @metadata,
346
393
  }.to_json(options)
347
394
  end
348
395
  end
@@ -363,20 +410,36 @@ module Twilio
363
410
  class UpdateConversationByIdRequest
364
411
  # @param [name]: [String] The name of the Conversation.
365
412
  # @param [status]: [String] Lifecycle status of a Conversation.
366
- attr_accessor :name, :status
413
+ # @param [metadata]: [Hash<String, String>] Customer-managed key-value metadata for this Conversation. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters.
414
+ attr_accessor :name, :status, :metadata
367
415
  def initialize(payload)
368
416
  @name = payload["name"]
369
417
  @status = payload["status"]
418
+ @metadata = payload["metadata"]
370
419
  end
371
420
  def to_json(options = {})
372
421
  {
373
422
  "name": @name,
374
423
  "status": @status,
424
+ "metadata": @metadata,
375
425
  }.to_json(options)
376
426
  end
377
427
  end
378
428
 
379
429
 
430
+ class ConversationWorkflow
431
+ # @param [flow_id]: [String] The Studio Flow to run.
432
+ attr_accessor :flow_id
433
+ def initialize(payload)
434
+ @flow_id = payload["flow_id"]
435
+ end
436
+ def to_json(options = {})
437
+ {
438
+ "flowId": @flow_id,
439
+ }.to_json(options)
440
+ end
441
+ end
442
+
380
443
  class ConversationsV2Address
381
444
  # @param [channel]: [ConversationsV2Channel]
382
445
  # @param [address]: [String] The address value formatted according to channel type: - SMS/VOICE: E.164 phone number (such as \"+18005550100\") - WHATSAPP: Phone number with whatsapp prefix (such as \"whatsapp:+18005550100\") - RCS: Sender ID or phone number with rcs prefix (such as \"rcs:brand_acme_agent\" or \"rcs:+18005550100\") - CHAT: Customer-defined string identifier
@@ -436,12 +499,14 @@ module Twilio
436
499
  # @param [name]: [String] The name of the conversation.
437
500
  # @param [configuration]: [ConversationList.CreateConversationWithConfigRequestConfiguration]
438
501
  # @param [participants]: [Array<ConversationList.CreateConversationWithConfigRequestParticipants>] Optional list of Participants to create with the Conversation.
439
- attr_accessor :configuration_id, :name, :configuration, :participants
502
+ # @param [metadata]: [Hash<String, String>] Optional customer-managed key-value metadata for this Conversation. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters.
503
+ attr_accessor :configuration_id, :name, :configuration, :participants, :metadata
440
504
  def initialize(payload)
441
505
  @configuration_id = payload["configuration_id"]
442
506
  @name = payload["name"]
443
507
  @configuration = payload["configuration"]
444
508
  @participants = payload["participants"]
509
+ @metadata = payload["metadata"]
445
510
  end
446
511
  def to_json(options = {})
447
512
  {
@@ -449,19 +514,23 @@ module Twilio
449
514
  "name": @name,
450
515
  "configuration": @configuration,
451
516
  "participants": @participants,
517
+ "metadata": @metadata,
452
518
  }.to_json(options)
453
519
  end
454
520
  end
455
521
 
456
522
  class CreateConversationWithConfigRequestConfiguration
457
523
  # @param [intelligence_configuration_ids]: [Array<String>] A list of Conversational Intelligence configuration IDs.
458
- attr_accessor :intelligence_configuration_ids
524
+ # @param [workflows]: [Array<ConversationList.ConversationWorkflow>] The Workflows to associate with this Conversation. Overrides the Configuration's own.
525
+ attr_accessor :intelligence_configuration_ids, :workflows
459
526
  def initialize(payload)
460
527
  @intelligence_configuration_ids = payload["intelligence_configuration_ids"]
528
+ @workflows = payload["workflows"]
461
529
  end
462
530
  def to_json(options = {})
463
531
  {
464
532
  "intelligenceConfigurationIds": @intelligence_configuration_ids,
533
+ "workflows": @workflows,
465
534
  }.to_json(options)
466
535
  end
467
536
  end
@@ -511,17 +580,20 @@ module Twilio
511
580
  # @param [name]: [String] The name of the Conversation.
512
581
  # @param [status]: [String] Lifecycle status of a Conversation.
513
582
  # @param [configuration]: [ConversationList.PatchConversationByIdRequestConfiguration]
514
- attr_accessor :name, :status, :configuration
583
+ # @param [metadata]: [Hash<String, String>] Merge patch for customer-managed metadata (max 8 entries after merge). Provided keys are added or updated; keys set to null are removed; keys not mentioned are preserved.
584
+ attr_accessor :name, :status, :configuration, :metadata
515
585
  def initialize(payload)
516
586
  @name = payload["name"]
517
587
  @status = payload["status"]
518
588
  @configuration = payload["configuration"]
589
+ @metadata = payload["metadata"]
519
590
  end
520
591
  def to_json(options = {})
521
592
  {
522
593
  "name": @name,
523
594
  "status": @status,
524
595
  "configuration": @configuration,
596
+ "metadata": @metadata,
525
597
  }.to_json(options)
526
598
  end
527
599
  end
@@ -542,15 +614,18 @@ module Twilio
542
614
  class UpdateConversationByIdRequest
543
615
  # @param [name]: [String] The name of the Conversation.
544
616
  # @param [status]: [String] Lifecycle status of a Conversation.
545
- attr_accessor :name, :status
617
+ # @param [metadata]: [Hash<String, String>] Customer-managed key-value metadata for this Conversation. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters.
618
+ attr_accessor :name, :status, :metadata
546
619
  def initialize(payload)
547
620
  @name = payload["name"]
548
621
  @status = payload["status"]
622
+ @metadata = payload["metadata"]
549
623
  end
550
624
  def to_json(options = {})
551
625
  {
552
626
  "name": @name,
553
627
  "status": @status,
628
+ "metadata": @metadata,
554
629
  }.to_json(options)
555
630
  end
556
631
  end
@@ -1142,7 +1217,9 @@ module Twilio
1142
1217
  'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
1143
1218
  'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']),
1144
1219
  'configuration' => payload['configuration'],
1220
+ 'metadata' => payload['metadata'],
1145
1221
  'participants' => payload['participants'],
1222
+ 'action_id' => payload['action_id'],
1146
1223
  'status_url' => payload['status_url'],
1147
1224
  'related' => payload['related'],
1148
1225
  'display_name' => payload['display_name'],
@@ -1221,12 +1298,24 @@ module Twilio
1221
1298
  @properties['configuration']
1222
1299
  end
1223
1300
 
1301
+ ##
1302
+ # @return [Hash<String, String>] Customer-managed key-value pairs. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters.
1303
+ def metadata
1304
+ @properties['metadata']
1305
+ end
1306
+
1224
1307
  ##
1225
1308
  # @return [Array<ConversationsV2Participant>] Participants in this Conversation.
1226
1309
  def participants
1227
1310
  @properties['participants']
1228
1311
  end
1229
1312
 
1313
+ ##
1314
+ # @return [String] The Action created for the request's `action`, present only on the create response that dispatched one. Poll `GET /v2/Conversations/{ConversationId}/Actions/{ActionId}` for its status.
1315
+ def action_id
1316
+ @properties['action_id']
1317
+ end
1318
+
1230
1319
  ##
1231
1320
  # @return [String] URL to poll for operation status.
1232
1321
  def status_url
@@ -0,0 +1,161 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Insights
8
+ # The Twilio Insights v3 API provides semantic query access to Conversations analytics data. Resources include synchronous Query, Metadata, and asynchronous QueryJobs for long-running queries.
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 Insights < InsightsBase
19
+ class V3 < Version
20
+ class CapacityList < ListResource
21
+
22
+ ##
23
+ # Initialize the CapacityList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [CapacityList] CapacityList
26
+ def initialize(version)
27
+
28
+ apiV1Version = ApiV1Version.new version.domain, version
29
+ super(apiV1Version)
30
+ # Path Solution
31
+ @solution = { }
32
+ @uri = "/ControlPlane/ConversationInsights/CustomFieldMappings/Capacity"
33
+
34
+ end
35
+ ##
36
+ # Fetch the CapacityInstance
37
+ # @return [CapacityInstance] Fetched CapacityInstance
38
+ def fetch
39
+
40
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
41
+
42
+
43
+
44
+
45
+
46
+ payload = @version.fetch('GET', @uri, headers: headers)
47
+ CapacityInstance.new(
48
+ @version,
49
+ payload,
50
+ )
51
+ end
52
+
53
+ ##
54
+ # Fetch the CapacityInstanceMetadata
55
+ # @return [CapacityInstance] Fetched CapacityInstance
56
+ def fetch_with_metadata
57
+
58
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
59
+
60
+
61
+
62
+
63
+
64
+ response = @version.fetch_with_metadata('GET', @uri, headers: headers)
65
+ capacity_instance = CapacityInstance.new(
66
+ @version,
67
+ response.body,
68
+ )
69
+ CapacityInstanceMetadata.new(
70
+ @version,
71
+ capacity_instance,
72
+ response.headers,
73
+ response.status_code
74
+ )
75
+ end
76
+
77
+
78
+
79
+
80
+ # Provide a user friendly representation
81
+ def to_s
82
+ '#<Twilio.Insights.V3.CapacityList>'
83
+ end
84
+ end
85
+
86
+ class CapacityPage < TokenPage
87
+ ##
88
+ # Initialize the CapacityPage
89
+ # @param [Version] version Version that contains the resource
90
+ # @param [Response] response Response from the API
91
+ # @param [Hash] solution Path solution for the resource
92
+ # @return [CapacityPage] CapacityPage
93
+ def initialize(version, response, solution)
94
+
95
+ apiV1Version = ApiV1Version.new version.domain, version
96
+ super(apiV1Version, response)
97
+
98
+ # Path Solution
99
+ @solution = solution
100
+ end
101
+
102
+ ##
103
+ # Build an instance of CapacityInstance
104
+ # @param [Hash] payload Payload response from the API
105
+ # @return [CapacityInstance] CapacityInstance
106
+ def get_instance(payload)
107
+ CapacityInstance.new(@version, payload)
108
+ end
109
+
110
+ ##
111
+ # Provide a user friendly representation
112
+ def to_s
113
+ '<Twilio.Insights.V3.CapacityPage>'
114
+ end
115
+ end
116
+
117
+ class CapacityInstance < InstanceResource
118
+ ##
119
+ # Initialize the CapacityInstance
120
+ # @param [Version] version Version that contains the resource
121
+ # @param [Hash] payload payload that contains response from Twilio
122
+ # @param [String] account_sid The SID of the
123
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Capacity
124
+ # resource.
125
+ # @param [String] sid The SID of the Call resource to fetch.
126
+ # @return [CapacityInstance] CapacityInstance
127
+ def initialize(version, payload )
128
+
129
+ apiV1Version = ApiV1Version.new version.domain, version
130
+ super(apiV1Version)
131
+
132
+ # Marshaled Properties
133
+ @properties = {
134
+ 'measure' => payload['measure'],
135
+ }
136
+ end
137
+
138
+
139
+ ##
140
+ # @return [CategoryCapacity]
141
+ def measure
142
+ @properties['measure']
143
+ end
144
+
145
+ ##
146
+ # Provide a user friendly representation
147
+ def to_s
148
+ "<Twilio.Insights.V3.CapacityInstance>"
149
+ end
150
+
151
+ ##
152
+ # Provide a detailed, user friendly representation
153
+ def inspect
154
+ "<Twilio.Insights.V3.CapacityInstance>"
155
+ end
156
+ end
157
+
158
+ end
159
+ end
160
+ end
161
+ end