twilio-ruby 5.74.3 → 5.75.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.
- checksums.yaml +4 -4
- data/CHANGES.md +34 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
- data/lib/twilio-ruby/rest/content/v1/content_and_approvals.rb +240 -0
- data/lib/twilio-ruby/rest/content/v1.rb +7 -0
- data/lib/twilio-ruby/rest/content.rb +6 -0
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +258 -17
- data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +216 -0
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +10 -3
- data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +95 -1
- data/lib/twilio-ruby/rest/flex_api/v1.rb +19 -3
- data/lib/twilio-ruby/rest/flex_api.rb +11 -3
- data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +4 -4
- data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +226 -0
- data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +218 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
- data/lib/twilio-ruby/rest/messaging.rb +18 -0
- data/lib/twilio-ruby/rest/microvisor/v1/account_config.rb +21 -1
- data/lib/twilio-ruby/rest/microvisor/v1/account_secret.rb +20 -0
- data/lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb +192 -0
- data/lib/twilio-ruby/rest/microvisor/v1/app.rb +25 -0
- data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +25 -0
- data/lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb +25 -0
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +21 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +0 -23
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +11 -7
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue_bulk_real_time_statistics.rb +0 -149
@@ -10,6 +10,8 @@ module Twilio
|
|
10
10
|
module REST
|
11
11
|
class FlexApi < Domain
|
12
12
|
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
13
15
|
class AssessmentsList < ListResource
|
14
16
|
##
|
15
17
|
# Initialize the AssessmentsList
|
@@ -20,6 +22,133 @@ module Twilio
|
|
20
22
|
|
21
23
|
# Path Solution
|
22
24
|
@solution = {}
|
25
|
+
@uri = "/Insights/QM/Assessments"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Create the AssessmentsInstance
|
30
|
+
# @param [String] category_id The id of the category
|
31
|
+
# @param [String] category_name The name of the category
|
32
|
+
# @param [String] segment_id Segment Id of the conversation
|
33
|
+
# @param [String] user_name Name of the user assessing conversation
|
34
|
+
# @param [String] user_email Email of the user assessing conversation
|
35
|
+
# @param [String] agent_id The id of the Agent
|
36
|
+
# @param [String] offset The offset of the conversation.
|
37
|
+
# @param [String] metric_id The question Id selected for assessment
|
38
|
+
# @param [String] metric_name The question name of the assessment
|
39
|
+
# @param [String] answer_text The answer text selected by user
|
40
|
+
# @param [String] answer_id The id of the answer selected by user
|
41
|
+
# @param [String] questionnaire_id Questionnaire Id of the associated question
|
42
|
+
# @param [String] token The Token HTTP request header
|
43
|
+
# @return [AssessmentsInstance] Created AssessmentsInstance
|
44
|
+
def create(category_id: nil, category_name: nil, segment_id: nil, user_name: nil, user_email: nil, agent_id: nil, offset: nil, metric_id: nil, metric_name: nil, answer_text: nil, answer_id: nil, questionnaire_id: nil, token: :unset)
|
45
|
+
data = Twilio::Values.of({
|
46
|
+
'CategoryId' => category_id,
|
47
|
+
'CategoryName' => category_name,
|
48
|
+
'SegmentId' => segment_id,
|
49
|
+
'UserName' => user_name,
|
50
|
+
'UserEmail' => user_email,
|
51
|
+
'AgentId' => agent_id,
|
52
|
+
'Offset' => offset,
|
53
|
+
'MetricId' => metric_id,
|
54
|
+
'MetricName' => metric_name,
|
55
|
+
'AnswerText' => answer_text,
|
56
|
+
'AnswerId' => answer_id,
|
57
|
+
'QuestionnaireId' => questionnaire_id,
|
58
|
+
})
|
59
|
+
headers = Twilio::Values.of({'Token' => token, })
|
60
|
+
|
61
|
+
payload = @version.create('POST', @uri, data: data, headers: headers)
|
62
|
+
|
63
|
+
AssessmentsInstance.new(@version, payload, )
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# Lists AssessmentsInstance records from the API as a list.
|
68
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
69
|
+
# memory before returning.
|
70
|
+
# @param [String] segment_id The id of the segment.
|
71
|
+
# @param [String] token The Token HTTP request header
|
72
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
73
|
+
# guarantees to never return more than limit. Default is no limit
|
74
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
75
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
76
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
77
|
+
# efficient page size, i.e. min(limit, 1000)
|
78
|
+
# @return [Array] Array of up to limit results
|
79
|
+
def list(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
|
80
|
+
self.stream(segment_id: segment_id, token: token, limit: limit, page_size: page_size).entries
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Streams AssessmentsInstance records from the API as an Enumerable.
|
85
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
86
|
+
# is reached.
|
87
|
+
# @param [String] segment_id The id of the segment.
|
88
|
+
# @param [String] token The Token HTTP request header
|
89
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
90
|
+
# guarantees to never return more than limit. Default is no limit.
|
91
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
92
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
93
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
94
|
+
# efficient page size, i.e. min(limit, 1000)
|
95
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
96
|
+
def stream(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
|
97
|
+
limits = @version.read_limits(limit, page_size)
|
98
|
+
|
99
|
+
page = self.page(segment_id: segment_id, token: token, page_size: limits[:page_size], )
|
100
|
+
|
101
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# When passed a block, yields AssessmentsInstance records from the API.
|
106
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
107
|
+
# is reached.
|
108
|
+
def each
|
109
|
+
limits = @version.read_limits
|
110
|
+
|
111
|
+
page = self.page(page_size: limits[:page_size], )
|
112
|
+
|
113
|
+
@version.stream(page,
|
114
|
+
limit: limits[:limit],
|
115
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# Retrieve a single page of AssessmentsInstance records from the API.
|
120
|
+
# Request is executed immediately.
|
121
|
+
# @param [String] segment_id The id of the segment.
|
122
|
+
# @param [String] token The Token HTTP request header
|
123
|
+
# @param [String] page_token PageToken provided by the API
|
124
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
125
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
126
|
+
# @return [Page] Page of AssessmentsInstance
|
127
|
+
def page(segment_id: :unset, token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
128
|
+
params = Twilio::Values.of({
|
129
|
+
'SegmentId' => segment_id,
|
130
|
+
'PageToken' => page_token,
|
131
|
+
'Page' => page_number,
|
132
|
+
'PageSize' => page_size,
|
133
|
+
})
|
134
|
+
headers = Twilio::Values.of({'Token' => token, })
|
135
|
+
|
136
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
137
|
+
|
138
|
+
AssessmentsPage.new(@version, response, @solution)
|
139
|
+
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# Retrieve a single page of AssessmentsInstance records from the API.
|
143
|
+
# Request is executed immediately.
|
144
|
+
# @param [String] target_url API-generated URL for the requested results page
|
145
|
+
# @return [Page] Page of AssessmentsInstance
|
146
|
+
def get_page(target_url)
|
147
|
+
response = @version.domain.request(
|
148
|
+
'GET',
|
149
|
+
target_url
|
150
|
+
)
|
151
|
+
AssessmentsPage.new(@version, response, @solution)
|
23
152
|
end
|
24
153
|
|
25
154
|
##
|
@@ -29,6 +158,8 @@ module Twilio
|
|
29
158
|
end
|
30
159
|
end
|
31
160
|
|
161
|
+
##
|
162
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
32
163
|
class AssessmentsPage < Page
|
33
164
|
##
|
34
165
|
# Initialize the AssessmentsPage
|
@@ -58,26 +189,36 @@ module Twilio
|
|
58
189
|
end
|
59
190
|
end
|
60
191
|
|
192
|
+
##
|
193
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
61
194
|
class AssessmentsContext < InstanceContext
|
62
195
|
##
|
63
196
|
# Initialize the AssessmentsContext
|
64
197
|
# @param [Version] version Version that contains the resource
|
198
|
+
# @param [String] assessment_id The id of the assessment to be modified
|
65
199
|
# @return [AssessmentsContext] AssessmentsContext
|
66
|
-
def initialize(version)
|
200
|
+
def initialize(version, assessment_id)
|
67
201
|
super(version)
|
68
202
|
|
69
203
|
# Path Solution
|
70
|
-
@solution = {}
|
71
|
-
@uri = "/
|
204
|
+
@solution = {assessment_id: assessment_id, }
|
205
|
+
@uri = "/Insights/QM/Assessments/#{@solution[:assessment_id]}"
|
72
206
|
end
|
73
207
|
|
74
208
|
##
|
75
|
-
#
|
76
|
-
# @
|
77
|
-
|
78
|
-
|
209
|
+
# Update the AssessmentsInstance
|
210
|
+
# @param [String] offset The offset of the conversation
|
211
|
+
# @param [String] answer_text The answer text selected by user
|
212
|
+
# @param [String] answer_id The id of the answer selected by user
|
213
|
+
# @param [String] token The Token HTTP request header
|
214
|
+
# @return [AssessmentsInstance] Updated AssessmentsInstance
|
215
|
+
def update(offset: nil, answer_text: nil, answer_id: nil, token: :unset)
|
216
|
+
data = Twilio::Values.of({'Offset' => offset, 'AnswerText' => answer_text, 'AnswerId' => answer_id, })
|
217
|
+
headers = Twilio::Values.of({'Token' => token, })
|
79
218
|
|
80
|
-
|
219
|
+
payload = @version.update('POST', @uri, data: data, headers: headers)
|
220
|
+
|
221
|
+
AssessmentsInstance.new(@version, payload, assessment_id: @solution[:assessment_id], )
|
81
222
|
end
|
82
223
|
|
83
224
|
##
|
@@ -95,21 +236,39 @@ module Twilio
|
|
95
236
|
end
|
96
237
|
end
|
97
238
|
|
239
|
+
##
|
240
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
98
241
|
class AssessmentsInstance < InstanceResource
|
99
242
|
##
|
100
243
|
# Initialize the AssessmentsInstance
|
101
244
|
# @param [Version] version Version that contains the resource
|
102
245
|
# @param [Hash] payload payload that contains response from Twilio
|
246
|
+
# @param [String] assessment_id The id of the assessment to be modified
|
103
247
|
# @return [AssessmentsInstance] AssessmentsInstance
|
104
|
-
def initialize(version, payload)
|
248
|
+
def initialize(version, payload, assessment_id: nil)
|
105
249
|
super(version)
|
106
250
|
|
107
251
|
# Marshaled Properties
|
108
|
-
@properties = {
|
252
|
+
@properties = {
|
253
|
+
'account_sid' => payload['account_sid'],
|
254
|
+
'assessment_id' => payload['assessment_id'],
|
255
|
+
'offset' => payload['offset'] == nil ? payload['offset'] : payload['offset'].to_f,
|
256
|
+
'report' => payload['report'],
|
257
|
+
'weight' => payload['weight'] == nil ? payload['weight'] : payload['weight'].to_f,
|
258
|
+
'agent_id' => payload['agent_id'],
|
259
|
+
'segment_id' => payload['segment_id'],
|
260
|
+
'user_name' => payload['user_name'],
|
261
|
+
'user_email' => payload['user_email'],
|
262
|
+
'answer_text' => payload['answer_text'],
|
263
|
+
'answer_id' => payload['answer_id'],
|
264
|
+
'assessment' => payload['assessment'],
|
265
|
+
'timestamp' => payload['timestamp'] == nil ? payload['timestamp'] : payload['timestamp'].to_f,
|
266
|
+
'url' => payload['url'],
|
267
|
+
}
|
109
268
|
|
110
269
|
# Context
|
111
270
|
@instance_context = nil
|
112
|
-
@params = {}
|
271
|
+
@params = {'assessment_id' => assessment_id || @properties['assessment_id'], }
|
113
272
|
end
|
114
273
|
|
115
274
|
##
|
@@ -118,22 +277,104 @@ module Twilio
|
|
118
277
|
# @return [AssessmentsContext] AssessmentsContext for this AssessmentsInstance
|
119
278
|
def context
|
120
279
|
unless @instance_context
|
121
|
-
@instance_context = AssessmentsContext.new(@version, )
|
280
|
+
@instance_context = AssessmentsContext.new(@version, @params['assessment_id'], )
|
122
281
|
end
|
123
282
|
@instance_context
|
124
283
|
end
|
125
284
|
|
126
285
|
##
|
127
|
-
# @return [String]
|
286
|
+
# @return [String] Account Sid.
|
287
|
+
def account_sid
|
288
|
+
@properties['account_sid']
|
289
|
+
end
|
290
|
+
|
291
|
+
##
|
292
|
+
# @return [String] Assessment id
|
293
|
+
def assessment_id
|
294
|
+
@properties['assessment_id']
|
295
|
+
end
|
296
|
+
|
297
|
+
##
|
298
|
+
# @return [String] offset
|
299
|
+
def offset
|
300
|
+
@properties['offset']
|
301
|
+
end
|
302
|
+
|
303
|
+
##
|
304
|
+
# @return [Boolean] Part of assessment report
|
305
|
+
def report
|
306
|
+
@properties['report']
|
307
|
+
end
|
308
|
+
|
309
|
+
##
|
310
|
+
# @return [String] The weightage
|
311
|
+
def weight
|
312
|
+
@properties['weight']
|
313
|
+
end
|
314
|
+
|
315
|
+
##
|
316
|
+
# @return [String] AgentID
|
317
|
+
def agent_id
|
318
|
+
@properties['agent_id']
|
319
|
+
end
|
320
|
+
|
321
|
+
##
|
322
|
+
# @return [String] Segment Id
|
323
|
+
def segment_id
|
324
|
+
@properties['segment_id']
|
325
|
+
end
|
326
|
+
|
327
|
+
##
|
328
|
+
# @return [String] The user name.
|
329
|
+
def user_name
|
330
|
+
@properties['user_name']
|
331
|
+
end
|
332
|
+
|
333
|
+
##
|
334
|
+
# @return [String] The user email id.
|
335
|
+
def user_email
|
336
|
+
@properties['user_email']
|
337
|
+
end
|
338
|
+
|
339
|
+
##
|
340
|
+
# @return [String] Answer text
|
341
|
+
def answer_text
|
342
|
+
@properties['answer_text']
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# @return [String] Answer Id
|
347
|
+
def answer_id
|
348
|
+
@properties['answer_id']
|
349
|
+
end
|
350
|
+
|
351
|
+
##
|
352
|
+
# @return [Hash] Assessment Details
|
353
|
+
def assessment
|
354
|
+
@properties['assessment']
|
355
|
+
end
|
356
|
+
|
357
|
+
##
|
358
|
+
# @return [String] The timestamp
|
359
|
+
def timestamp
|
360
|
+
@properties['timestamp']
|
361
|
+
end
|
362
|
+
|
363
|
+
##
|
364
|
+
# @return [String] The url
|
128
365
|
def url
|
129
366
|
@properties['url']
|
130
367
|
end
|
131
368
|
|
132
369
|
##
|
133
|
-
#
|
134
|
-
# @
|
135
|
-
|
136
|
-
|
370
|
+
# Update the AssessmentsInstance
|
371
|
+
# @param [String] offset The offset of the conversation
|
372
|
+
# @param [String] answer_text The answer text selected by user
|
373
|
+
# @param [String] answer_id The id of the answer selected by user
|
374
|
+
# @param [String] token The Token HTTP request header
|
375
|
+
# @return [AssessmentsInstance] Updated AssessmentsInstance
|
376
|
+
def update(offset: nil, answer_text: nil, answer_id: nil, token: :unset)
|
377
|
+
context.update(offset: offset, answer_text: answer_text, answer_id: answer_id, token: token, )
|
137
378
|
end
|
138
379
|
|
139
380
|
##
|
@@ -0,0 +1,216 @@
|
|
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 FlexApi < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
15
|
+
class InsightsConversationsList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the InsightsConversationsList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [InsightsConversationsList] InsightsConversationsList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/Insights/Conversations"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Lists InsightsConversationsInstance records from the API as a list.
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
+
# memory before returning.
|
32
|
+
# @param [String] segment_id Unique Id of the segment for which conversation
|
33
|
+
# details needs to be fetched
|
34
|
+
# @param [String] token The Token HTTP request header
|
35
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
36
|
+
# guarantees to never return more than limit. Default is no limit
|
37
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
38
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
39
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
40
|
+
# efficient page size, i.e. min(limit, 1000)
|
41
|
+
# @return [Array] Array of up to limit results
|
42
|
+
def list(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
|
43
|
+
self.stream(segment_id: segment_id, token: token, limit: limit, page_size: page_size).entries
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Streams InsightsConversationsInstance records from the API as an Enumerable.
|
48
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
49
|
+
# is reached.
|
50
|
+
# @param [String] segment_id Unique Id of the segment for which conversation
|
51
|
+
# details needs to be fetched
|
52
|
+
# @param [String] token The Token HTTP request header
|
53
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
54
|
+
# guarantees to never return more than limit. Default is no limit.
|
55
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
56
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
57
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
58
|
+
# efficient page size, i.e. min(limit, 1000)
|
59
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
60
|
+
def stream(segment_id: :unset, token: :unset, limit: nil, page_size: nil)
|
61
|
+
limits = @version.read_limits(limit, page_size)
|
62
|
+
|
63
|
+
page = self.page(segment_id: segment_id, token: token, page_size: limits[:page_size], )
|
64
|
+
|
65
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# When passed a block, yields InsightsConversationsInstance records from the API.
|
70
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
71
|
+
# is reached.
|
72
|
+
def each
|
73
|
+
limits = @version.read_limits
|
74
|
+
|
75
|
+
page = self.page(page_size: limits[:page_size], )
|
76
|
+
|
77
|
+
@version.stream(page,
|
78
|
+
limit: limits[:limit],
|
79
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
80
|
+
end
|
81
|
+
|
82
|
+
##
|
83
|
+
# Retrieve a single page of InsightsConversationsInstance records from the API.
|
84
|
+
# Request is executed immediately.
|
85
|
+
# @param [String] segment_id Unique Id of the segment for which conversation
|
86
|
+
# details needs to be fetched
|
87
|
+
# @param [String] token The Token HTTP request header
|
88
|
+
# @param [String] page_token PageToken provided by the API
|
89
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
90
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
91
|
+
# @return [Page] Page of InsightsConversationsInstance
|
92
|
+
def page(segment_id: :unset, token: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
93
|
+
params = Twilio::Values.of({
|
94
|
+
'SegmentId' => segment_id,
|
95
|
+
'PageToken' => page_token,
|
96
|
+
'Page' => page_number,
|
97
|
+
'PageSize' => page_size,
|
98
|
+
})
|
99
|
+
headers = Twilio::Values.of({'Token' => token, })
|
100
|
+
|
101
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
102
|
+
|
103
|
+
InsightsConversationsPage.new(@version, response, @solution)
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Retrieve a single page of InsightsConversationsInstance records from the API.
|
108
|
+
# Request is executed immediately.
|
109
|
+
# @param [String] target_url API-generated URL for the requested results page
|
110
|
+
# @return [Page] Page of InsightsConversationsInstance
|
111
|
+
def get_page(target_url)
|
112
|
+
response = @version.domain.request(
|
113
|
+
'GET',
|
114
|
+
target_url
|
115
|
+
)
|
116
|
+
InsightsConversationsPage.new(@version, response, @solution)
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Provide a user friendly representation
|
121
|
+
def to_s
|
122
|
+
'#<Twilio.FlexApi.V1.InsightsConversationsList>'
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
##
|
127
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
128
|
+
class InsightsConversationsPage < Page
|
129
|
+
##
|
130
|
+
# Initialize the InsightsConversationsPage
|
131
|
+
# @param [Version] version Version that contains the resource
|
132
|
+
# @param [Response] response Response from the API
|
133
|
+
# @param [Hash] solution Path solution for the resource
|
134
|
+
# @return [InsightsConversationsPage] InsightsConversationsPage
|
135
|
+
def initialize(version, response, solution)
|
136
|
+
super(version, response)
|
137
|
+
|
138
|
+
# Path Solution
|
139
|
+
@solution = solution
|
140
|
+
end
|
141
|
+
|
142
|
+
##
|
143
|
+
# Build an instance of InsightsConversationsInstance
|
144
|
+
# @param [Hash] payload Payload response from the API
|
145
|
+
# @return [InsightsConversationsInstance] InsightsConversationsInstance
|
146
|
+
def get_instance(payload)
|
147
|
+
InsightsConversationsInstance.new(@version, payload, )
|
148
|
+
end
|
149
|
+
|
150
|
+
##
|
151
|
+
# Provide a user friendly representation
|
152
|
+
def to_s
|
153
|
+
'<Twilio.FlexApi.V1.InsightsConversationsPage>'
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
159
|
+
class InsightsConversationsInstance < InstanceResource
|
160
|
+
##
|
161
|
+
# Initialize the InsightsConversationsInstance
|
162
|
+
# @param [Version] version Version that contains the resource
|
163
|
+
# @param [Hash] payload payload that contains response from Twilio
|
164
|
+
# @return [InsightsConversationsInstance] InsightsConversationsInstance
|
165
|
+
def initialize(version, payload)
|
166
|
+
super(version)
|
167
|
+
|
168
|
+
# Marshaled Properties
|
169
|
+
@properties = {
|
170
|
+
'account_id' => payload['account_id'],
|
171
|
+
'conversation_id' => payload['conversation_id'],
|
172
|
+
'segment_count' => payload['segment_count'] == nil ? payload['segment_count'] : payload['segment_count'].to_i,
|
173
|
+
'segments' => payload['segments'],
|
174
|
+
}
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# @return [String] The account id
|
179
|
+
def account_id
|
180
|
+
@properties['account_id']
|
181
|
+
end
|
182
|
+
|
183
|
+
##
|
184
|
+
# @return [String] Unique conversation Id
|
185
|
+
def conversation_id
|
186
|
+
@properties['conversation_id']
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# @return [String] The segment count
|
191
|
+
def segment_count
|
192
|
+
@properties['segment_count']
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# @return [Array[Hash]] The conversation segments
|
197
|
+
def segments
|
198
|
+
@properties['segments']
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Provide a user friendly representation
|
203
|
+
def to_s
|
204
|
+
"<Twilio.FlexApi.V1.InsightsConversationsInstance>"
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# Provide a detailed, user friendly representation
|
209
|
+
def inspect
|
210
|
+
"<Twilio.FlexApi.V1.InsightsConversationsInstance>"
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
@@ -29,18 +29,18 @@ module Twilio
|
|
29
29
|
# Create the InsightsQuestionnairesQuestionInstance
|
30
30
|
# @param [String] category_id The ID of the category
|
31
31
|
# @param [String] question The question.
|
32
|
-
# @param [String] description The description for the question.
|
33
32
|
# @param [String] answer_set_id The answer_set for the question.
|
34
33
|
# @param [Boolean] allow_na The flag to enable for disable NA for answer.
|
34
|
+
# @param [String] description The description for the question.
|
35
35
|
# @param [String] token The Token HTTP request header
|
36
36
|
# @return [InsightsQuestionnairesQuestionInstance] Created InsightsQuestionnairesQuestionInstance
|
37
|
-
def create(category_id: nil, question: nil,
|
37
|
+
def create(category_id: nil, question: nil, answer_set_id: nil, allow_na: nil, description: :unset, token: :unset)
|
38
38
|
data = Twilio::Values.of({
|
39
39
|
'CategoryId' => category_id,
|
40
40
|
'Question' => question,
|
41
|
-
'Description' => description,
|
42
41
|
'AnswerSetId' => answer_set_id,
|
43
42
|
'AllowNa' => allow_na,
|
43
|
+
'Description' => description,
|
44
44
|
})
|
45
45
|
headers = Twilio::Values.of({'Token' => token, })
|
46
46
|
|
@@ -262,6 +262,7 @@ module Twilio
|
|
262
262
|
'answer_set_id' => payload['answer_set_id'],
|
263
263
|
'allow_na' => payload['allow_na'],
|
264
264
|
'usage' => payload['usage'] == nil ? payload['usage'] : payload['usage'].to_i,
|
265
|
+
'answer_set' => payload['answer_set'],
|
265
266
|
'url' => payload['url'],
|
266
267
|
}
|
267
268
|
|
@@ -329,6 +330,12 @@ module Twilio
|
|
329
330
|
@properties['usage']
|
330
331
|
end
|
331
332
|
|
333
|
+
##
|
334
|
+
# @return [Hash] Question's Answer set
|
335
|
+
def answer_set
|
336
|
+
@properties['answer_set']
|
337
|
+
end
|
338
|
+
|
332
339
|
##
|
333
340
|
# @return [String] The url
|
334
341
|
def url
|