twilio-ruby 5.74.1 → 5.74.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be77b63828134bd9390c83f201fec04010268e1f
4
- data.tar.gz: c8f48178261040ee75ad63b3ddd1731b60522373
3
+ metadata.gz: 6f6b2220266b0f6e98b681dcb4f4d24a704c3f4a
4
+ data.tar.gz: a8d8f8886ec20094497b5597798acee24c6fe833
5
5
  SHA512:
6
- metadata.gz: 47d4ad18d6185451d97af2a33cdd4b38773389e59c50f51b37c3ca34ac759a14a91c093de17b9c5cd99574189e04fee79c1613a64a5a047e5cca2254e218cd19
7
- data.tar.gz: 259032db93a0b08ca406f890d2d118ee4fb35327a8579c0afd7d18c25aea153108c87ec807b1c4e2dda0147c56bc54b72ce941fdef9e544b8696c55f1153194f
6
+ metadata.gz: 4f35bb732d3b023f75291b92fde1b254c44a5014ca729580c9fc108d2ee20121eb8a386f3bb7ae7a865d720e9ba7d097f92b8e689bcf698335506d18289e46b8
7
+ data.tar.gz: ed8b7139afc7499287a96970e105911dad04521e38afe7084e281d406926be4149c59d819ba8e3169c40f21f8d65defd58d8302d1f733284a299932959e97d9d
data/CHANGES.md CHANGED
@@ -1,6 +1,21 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2023-01-25] Version 5.74.2
5
+ ---------------------------
6
+ **Api**
7
+ - Add `public_application_connect_enabled` param to Application resource
8
+
9
+ **Messaging**
10
+ - Add new tollfree verification API property (ExternalReferenceId)]
11
+
12
+ **Verify**
13
+ - Add `device_ip` parameter and channel `auto` for sna/sms orchestration
14
+
15
+ **Twiml**
16
+ - Add support for `<Application>` noun and `<ApplicationSid>` noun, nested `<Parameter>` to `<Hangup>` and `<Leave>` verb
17
+
18
+
4
19
  [2023-01-11] Version 5.74.1
5
20
  ---------------------------
6
21
  **Library - Chore**
data/README.md CHANGED
@@ -34,13 +34,13 @@ This library supports the following Ruby implementations:
34
34
  To install using [Bundler][bundler] grab the latest stable version:
35
35
 
36
36
  ```ruby
37
- gem 'twilio-ruby', '~> 5.74.1'
37
+ gem 'twilio-ruby', '~> 5.74.2'
38
38
  ```
39
39
 
40
40
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
41
41
 
42
42
  ```bash
43
- gem install twilio-ruby -v 5.74.1
43
+ gem install twilio-ruby -v 5.74.2
44
44
  ```
45
45
 
46
46
  To build and install the development branch yourself from the latest source:
@@ -61,8 +61,11 @@ module Twilio
61
61
  # method to send message status information to your application.
62
62
  # @param [String] friendly_name A descriptive string that you create to describe
63
63
  # the new application. It can be up to 64 characters long.
64
+ # @param [Boolean] public_application_connect_enabled Whether to allow other
65
+ # Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or
66
+ # `false`.
64
67
  # @return [ApplicationInstance] Created ApplicationInstance
65
- def create(api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, friendly_name: :unset)
68
+ def create(api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, friendly_name: :unset, public_application_connect_enabled: :unset)
66
69
  data = Twilio::Values.of({
67
70
  'ApiVersion' => api_version,
68
71
  'VoiceUrl' => voice_url,
@@ -79,6 +82,7 @@ module Twilio
79
82
  'SmsStatusCallback' => sms_status_callback,
80
83
  'MessageStatusCallback' => message_status_callback,
81
84
  'FriendlyName' => friendly_name,
85
+ 'PublicApplicationConnectEnabled' => public_application_connect_enabled,
82
86
  })
83
87
 
84
88
  payload = @version.create('POST', @uri, data: data)
@@ -283,8 +287,11 @@ module Twilio
283
287
  # sent by the application. Deprecated, included for backwards compatibility.
284
288
  # @param [String] message_status_callback The URL we should call using a POST
285
289
  # method to send message status information to your application.
290
+ # @param [Boolean] public_application_connect_enabled Whether to allow other
291
+ # Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or
292
+ # `false`.
286
293
  # @return [ApplicationInstance] Updated ApplicationInstance
287
- def update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset)
294
+ def update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, public_application_connect_enabled: :unset)
288
295
  data = Twilio::Values.of({
289
296
  'FriendlyName' => friendly_name,
290
297
  'ApiVersion' => api_version,
@@ -301,6 +308,7 @@ module Twilio
301
308
  'SmsFallbackMethod' => sms_fallback_method,
302
309
  'SmsStatusCallback' => sms_status_callback,
303
310
  'MessageStatusCallback' => message_status_callback,
311
+ 'PublicApplicationConnectEnabled' => public_application_connect_enabled,
304
312
  })
305
313
 
306
314
  payload = @version.update('POST', @uri, data: data)
@@ -364,6 +372,7 @@ module Twilio
364
372
  'voice_fallback_url' => payload['voice_fallback_url'],
365
373
  'voice_method' => payload['voice_method'],
366
374
  'voice_url' => payload['voice_url'],
375
+ 'public_application_connect_enabled' => payload['public_application_connect_enabled'],
367
376
  }
368
377
 
369
378
  # Context
@@ -502,6 +511,12 @@ module Twilio
502
511
  @properties['voice_url']
503
512
  end
504
513
 
514
+ ##
515
+ # @return [Boolean] Whether to allow other Twilio accounts to dial this application
516
+ def public_application_connect_enabled
517
+ @properties['public_application_connect_enabled']
518
+ end
519
+
505
520
  ##
506
521
  # Delete the ApplicationInstance
507
522
  # @return [Boolean] true if delete succeeds, false otherwise
@@ -551,8 +566,11 @@ module Twilio
551
566
  # sent by the application. Deprecated, included for backwards compatibility.
552
567
  # @param [String] message_status_callback The URL we should call using a POST
553
568
  # method to send message status information to your application.
569
+ # @param [Boolean] public_application_connect_enabled Whether to allow other
570
+ # Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or
571
+ # `false`.
554
572
  # @return [ApplicationInstance] Updated ApplicationInstance
555
- def update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset)
573
+ def update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, public_application_connect_enabled: :unset)
556
574
  context.update(
557
575
  friendly_name: friendly_name,
558
576
  api_version: api_version,
@@ -569,6 +587,7 @@ module Twilio
569
587
  sms_fallback_method: sms_fallback_method,
570
588
  sms_status_callback: sms_status_callback,
571
589
  message_status_callback: message_status_callback,
590
+ public_application_connect_enabled: public_application_connect_enabled,
572
591
  )
573
592
  end
574
593
 
@@ -40,7 +40,7 @@ module Twilio
40
40
  # @param [String] idempotency_key A unique string value to identify API call. This
41
41
  # should be a unique string value per API call and can be a randomly generated.
42
42
  # @param [String] method The HTTP method Twilio will use when requesting the above
43
- # `Url`. Either `GET` or `POST`.
43
+ # `Url`. Either `GET` or `POST`. Default is `POST`.
44
44
  # @return [UserDefinedMessageSubscriptionInstance] Created UserDefinedMessageSubscriptionInstance
45
45
  def create(callback: nil, idempotency_key: :unset, method: :unset)
46
46
  data = Twilio::Values.of({
@@ -0,0 +1,229 @@
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 InsightsQuestionnairesCategoryList < ListResource
16
+ ##
17
+ # Initialize the InsightsQuestionnairesCategoryList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [InsightsQuestionnairesCategoryList] InsightsQuestionnairesCategoryList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Insights/QM/Categories"
26
+ end
27
+
28
+ ##
29
+ # Create the InsightsQuestionnairesCategoryInstance
30
+ # @param [String] name The name of this category.
31
+ # @param [String] token The Token HTTP request header
32
+ # @return [InsightsQuestionnairesCategoryInstance] Created InsightsQuestionnairesCategoryInstance
33
+ def create(name: nil, token: :unset)
34
+ data = Twilio::Values.of({'Name' => name, })
35
+ headers = Twilio::Values.of({'Token' => token, })
36
+
37
+ payload = @version.create('POST', @uri, data: data, headers: headers)
38
+
39
+ InsightsQuestionnairesCategoryInstance.new(@version, payload, )
40
+ end
41
+
42
+ ##
43
+ # Provide a user friendly representation
44
+ def to_s
45
+ '#<Twilio.FlexApi.V1.InsightsQuestionnairesCategoryList>'
46
+ end
47
+ end
48
+
49
+ ##
50
+ # 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.
51
+ class InsightsQuestionnairesCategoryPage < Page
52
+ ##
53
+ # Initialize the InsightsQuestionnairesCategoryPage
54
+ # @param [Version] version Version that contains the resource
55
+ # @param [Response] response Response from the API
56
+ # @param [Hash] solution Path solution for the resource
57
+ # @return [InsightsQuestionnairesCategoryPage] InsightsQuestionnairesCategoryPage
58
+ def initialize(version, response, solution)
59
+ super(version, response)
60
+
61
+ # Path Solution
62
+ @solution = solution
63
+ end
64
+
65
+ ##
66
+ # Build an instance of InsightsQuestionnairesCategoryInstance
67
+ # @param [Hash] payload Payload response from the API
68
+ # @return [InsightsQuestionnairesCategoryInstance] InsightsQuestionnairesCategoryInstance
69
+ def get_instance(payload)
70
+ InsightsQuestionnairesCategoryInstance.new(@version, payload, )
71
+ end
72
+
73
+ ##
74
+ # Provide a user friendly representation
75
+ def to_s
76
+ '<Twilio.FlexApi.V1.InsightsQuestionnairesCategoryPage>'
77
+ end
78
+ end
79
+
80
+ ##
81
+ # 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.
82
+ class InsightsQuestionnairesCategoryContext < InstanceContext
83
+ ##
84
+ # Initialize the InsightsQuestionnairesCategoryContext
85
+ # @param [Version] version Version that contains the resource
86
+ # @param [String] category_id The ID of the category to be update
87
+ # @return [InsightsQuestionnairesCategoryContext] InsightsQuestionnairesCategoryContext
88
+ def initialize(version, category_id)
89
+ super(version)
90
+
91
+ # Path Solution
92
+ @solution = {category_id: category_id, }
93
+ @uri = "/Insights/QM/Categories/#{@solution[:category_id]}"
94
+ end
95
+
96
+ ##
97
+ # Update the InsightsQuestionnairesCategoryInstance
98
+ # @param [String] name The name of this category.
99
+ # @param [String] token The Token HTTP request header
100
+ # @return [InsightsQuestionnairesCategoryInstance] Updated InsightsQuestionnairesCategoryInstance
101
+ def update(name: nil, token: :unset)
102
+ data = Twilio::Values.of({'Name' => name, })
103
+ headers = Twilio::Values.of({'Token' => token, })
104
+
105
+ payload = @version.update('POST', @uri, data: data, headers: headers)
106
+
107
+ InsightsQuestionnairesCategoryInstance.new(@version, payload, category_id: @solution[:category_id], )
108
+ end
109
+
110
+ ##
111
+ # Delete the InsightsQuestionnairesCategoryInstance
112
+ # @param [String] token The Token HTTP request header
113
+ # @return [Boolean] true if delete succeeds, false otherwise
114
+ def delete(token: :unset)
115
+ headers = Twilio::Values.of({'Token' => token, })
116
+
117
+ @version.delete('DELETE', @uri, headers: headers)
118
+ end
119
+
120
+ ##
121
+ # Provide a user friendly representation
122
+ def to_s
123
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
124
+ "#<Twilio.FlexApi.V1.InsightsQuestionnairesCategoryContext #{context}>"
125
+ end
126
+
127
+ ##
128
+ # Provide a detailed, user friendly representation
129
+ def inspect
130
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
131
+ "#<Twilio.FlexApi.V1.InsightsQuestionnairesCategoryContext #{context}>"
132
+ end
133
+ end
134
+
135
+ ##
136
+ # 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.
137
+ class InsightsQuestionnairesCategoryInstance < InstanceResource
138
+ ##
139
+ # Initialize the InsightsQuestionnairesCategoryInstance
140
+ # @param [Version] version Version that contains the resource
141
+ # @param [Hash] payload payload that contains response from Twilio
142
+ # @param [String] category_id The ID of the category to be update
143
+ # @return [InsightsQuestionnairesCategoryInstance] InsightsQuestionnairesCategoryInstance
144
+ def initialize(version, payload, category_id: nil)
145
+ super(version)
146
+
147
+ # Marshaled Properties
148
+ @properties = {
149
+ 'account_sid' => payload['account_sid'],
150
+ 'category_id' => payload['category_id'],
151
+ 'name' => payload['name'],
152
+ 'url' => payload['url'],
153
+ }
154
+
155
+ # Context
156
+ @instance_context = nil
157
+ @params = {'category_id' => category_id || @properties['category_id'], }
158
+ end
159
+
160
+ ##
161
+ # Generate an instance context for the instance, the context is capable of
162
+ # performing various actions. All instance actions are proxied to the context
163
+ # @return [InsightsQuestionnairesCategoryContext] InsightsQuestionnairesCategoryContext for this InsightsQuestionnairesCategoryInstance
164
+ def context
165
+ unless @instance_context
166
+ @instance_context = InsightsQuestionnairesCategoryContext.new(@version, @params['category_id'], )
167
+ end
168
+ @instance_context
169
+ end
170
+
171
+ ##
172
+ # @return [String] The SID of the Account that created the resource and owns this Flex Insights
173
+ def account_sid
174
+ @properties['account_sid']
175
+ end
176
+
177
+ ##
178
+ # @return [String] Unique category ID
179
+ def category_id
180
+ @properties['category_id']
181
+ end
182
+
183
+ ##
184
+ # @return [String] The category name.
185
+ def name
186
+ @properties['name']
187
+ end
188
+
189
+ ##
190
+ # @return [String] The url
191
+ def url
192
+ @properties['url']
193
+ end
194
+
195
+ ##
196
+ # Update the InsightsQuestionnairesCategoryInstance
197
+ # @param [String] name The name of this category.
198
+ # @param [String] token The Token HTTP request header
199
+ # @return [InsightsQuestionnairesCategoryInstance] Updated InsightsQuestionnairesCategoryInstance
200
+ def update(name: nil, token: :unset)
201
+ context.update(name: name, token: token, )
202
+ end
203
+
204
+ ##
205
+ # Delete the InsightsQuestionnairesCategoryInstance
206
+ # @param [String] token The Token HTTP request header
207
+ # @return [Boolean] true if delete succeeds, false otherwise
208
+ def delete(token: :unset)
209
+ context.delete(token: token, )
210
+ end
211
+
212
+ ##
213
+ # Provide a user friendly representation
214
+ def to_s
215
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
216
+ "<Twilio.FlexApi.V1.InsightsQuestionnairesCategoryInstance #{values}>"
217
+ end
218
+
219
+ ##
220
+ # Provide a detailed, user friendly representation
221
+ def inspect
222
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
223
+ "<Twilio.FlexApi.V1.InsightsQuestionnairesCategoryInstance #{values}>"
224
+ end
225
+ end
226
+ end
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,288 @@
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 InsightsQuestionnairesQuestionList < ListResource
16
+ ##
17
+ # Initialize the InsightsQuestionnairesQuestionList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [InsightsQuestionnairesQuestionList] InsightsQuestionnairesQuestionList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Insights/QM/Questions"
26
+ end
27
+
28
+ ##
29
+ # Create the InsightsQuestionnairesQuestionInstance
30
+ # @param [String] category_id The ID of the category
31
+ # @param [String] question The question.
32
+ # @param [String] description The description for the question.
33
+ # @param [String] answer_set_id The answer_set for the question.
34
+ # @param [Boolean] allow_na The flag to enable for disable NA for answer.
35
+ # @param [String] token The Token HTTP request header
36
+ # @return [InsightsQuestionnairesQuestionInstance] Created InsightsQuestionnairesQuestionInstance
37
+ def create(category_id: nil, question: nil, description: nil, answer_set_id: nil, allow_na: nil, token: :unset)
38
+ data = Twilio::Values.of({
39
+ 'CategoryId' => category_id,
40
+ 'Question' => question,
41
+ 'Description' => description,
42
+ 'AnswerSetId' => answer_set_id,
43
+ 'AllowNa' => allow_na,
44
+ })
45
+ headers = Twilio::Values.of({'Token' => token, })
46
+
47
+ payload = @version.create('POST', @uri, data: data, headers: headers)
48
+
49
+ InsightsQuestionnairesQuestionInstance.new(@version, payload, )
50
+ end
51
+
52
+ ##
53
+ # Provide a user friendly representation
54
+ def to_s
55
+ '#<Twilio.FlexApi.V1.InsightsQuestionnairesQuestionList>'
56
+ end
57
+ end
58
+
59
+ ##
60
+ # 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
+ class InsightsQuestionnairesQuestionPage < Page
62
+ ##
63
+ # Initialize the InsightsQuestionnairesQuestionPage
64
+ # @param [Version] version Version that contains the resource
65
+ # @param [Response] response Response from the API
66
+ # @param [Hash] solution Path solution for the resource
67
+ # @return [InsightsQuestionnairesQuestionPage] InsightsQuestionnairesQuestionPage
68
+ def initialize(version, response, solution)
69
+ super(version, response)
70
+
71
+ # Path Solution
72
+ @solution = solution
73
+ end
74
+
75
+ ##
76
+ # Build an instance of InsightsQuestionnairesQuestionInstance
77
+ # @param [Hash] payload Payload response from the API
78
+ # @return [InsightsQuestionnairesQuestionInstance] InsightsQuestionnairesQuestionInstance
79
+ def get_instance(payload)
80
+ InsightsQuestionnairesQuestionInstance.new(@version, payload, )
81
+ end
82
+
83
+ ##
84
+ # Provide a user friendly representation
85
+ def to_s
86
+ '<Twilio.FlexApi.V1.InsightsQuestionnairesQuestionPage>'
87
+ end
88
+ end
89
+
90
+ ##
91
+ # 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.
92
+ class InsightsQuestionnairesQuestionContext < InstanceContext
93
+ ##
94
+ # Initialize the InsightsQuestionnairesQuestionContext
95
+ # @param [Version] version Version that contains the resource
96
+ # @param [String] question_id The unique ID of the question
97
+ # @return [InsightsQuestionnairesQuestionContext] InsightsQuestionnairesQuestionContext
98
+ def initialize(version, question_id)
99
+ super(version)
100
+
101
+ # Path Solution
102
+ @solution = {question_id: question_id, }
103
+ @uri = "/Insights/QM/Questions/#{@solution[:question_id]}"
104
+ end
105
+
106
+ ##
107
+ # Update the InsightsQuestionnairesQuestionInstance
108
+ # @param [String] question The question.
109
+ # @param [String] description The description for the question.
110
+ # @param [String] answer_set_id The answer_set for the question.
111
+ # @param [Boolean] allow_na The flag to enable for disable NA for answer.
112
+ # @param [String] category_id The ID of the category
113
+ # @param [String] token The Token HTTP request header
114
+ # @return [InsightsQuestionnairesQuestionInstance] Updated InsightsQuestionnairesQuestionInstance
115
+ def update(question: nil, description: nil, answer_set_id: nil, allow_na: nil, category_id: :unset, token: :unset)
116
+ data = Twilio::Values.of({
117
+ 'Question' => question,
118
+ 'Description' => description,
119
+ 'AnswerSetId' => answer_set_id,
120
+ 'AllowNa' => allow_na,
121
+ 'CategoryId' => category_id,
122
+ })
123
+ headers = Twilio::Values.of({'Token' => token, })
124
+
125
+ payload = @version.update('POST', @uri, data: data, headers: headers)
126
+
127
+ InsightsQuestionnairesQuestionInstance.new(@version, payload, question_id: @solution[:question_id], )
128
+ end
129
+
130
+ ##
131
+ # Delete the InsightsQuestionnairesQuestionInstance
132
+ # @param [String] token The Token HTTP request header
133
+ # @return [Boolean] true if delete succeeds, false otherwise
134
+ def delete(token: :unset)
135
+ headers = Twilio::Values.of({'Token' => token, })
136
+
137
+ @version.delete('DELETE', @uri, headers: headers)
138
+ end
139
+
140
+ ##
141
+ # Provide a user friendly representation
142
+ def to_s
143
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
144
+ "#<Twilio.FlexApi.V1.InsightsQuestionnairesQuestionContext #{context}>"
145
+ end
146
+
147
+ ##
148
+ # Provide a detailed, user friendly representation
149
+ def inspect
150
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
151
+ "#<Twilio.FlexApi.V1.InsightsQuestionnairesQuestionContext #{context}>"
152
+ end
153
+ end
154
+
155
+ ##
156
+ # 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.
157
+ class InsightsQuestionnairesQuestionInstance < InstanceResource
158
+ ##
159
+ # Initialize the InsightsQuestionnairesQuestionInstance
160
+ # @param [Version] version Version that contains the resource
161
+ # @param [Hash] payload payload that contains response from Twilio
162
+ # @param [String] question_id The unique ID of the question
163
+ # @return [InsightsQuestionnairesQuestionInstance] InsightsQuestionnairesQuestionInstance
164
+ def initialize(version, payload, question_id: nil)
165
+ super(version)
166
+
167
+ # Marshaled Properties
168
+ @properties = {
169
+ 'account_sid' => payload['account_sid'],
170
+ 'question_id' => payload['question_id'],
171
+ 'question' => payload['question'],
172
+ 'description' => payload['description'],
173
+ 'category' => payload['category'],
174
+ 'answer_set_id' => payload['answer_set_id'],
175
+ 'allow_na' => payload['allow_na'],
176
+ 'url' => payload['url'],
177
+ }
178
+
179
+ # Context
180
+ @instance_context = nil
181
+ @params = {'question_id' => question_id || @properties['question_id'], }
182
+ end
183
+
184
+ ##
185
+ # Generate an instance context for the instance, the context is capable of
186
+ # performing various actions. All instance actions are proxied to the context
187
+ # @return [InsightsQuestionnairesQuestionContext] InsightsQuestionnairesQuestionContext for this InsightsQuestionnairesQuestionInstance
188
+ def context
189
+ unless @instance_context
190
+ @instance_context = InsightsQuestionnairesQuestionContext.new(@version, @params['question_id'], )
191
+ end
192
+ @instance_context
193
+ end
194
+
195
+ ##
196
+ # @return [String] The SID of the Account that created the resource and owns this Flex Insights
197
+ def account_sid
198
+ @properties['account_sid']
199
+ end
200
+
201
+ ##
202
+ # @return [String] Unique Question ID
203
+ def question_id
204
+ @properties['question_id']
205
+ end
206
+
207
+ ##
208
+ # @return [String] The question.
209
+ def question
210
+ @properties['question']
211
+ end
212
+
213
+ ##
214
+ # @return [String] The question description.
215
+ def description
216
+ @properties['description']
217
+ end
218
+
219
+ ##
220
+ # @return [Hash] The question category.
221
+ def category
222
+ @properties['category']
223
+ end
224
+
225
+ ##
226
+ # @return [String] The answer_set for question.
227
+ def answer_set_id
228
+ @properties['answer_set_id']
229
+ end
230
+
231
+ ##
232
+ # @return [Boolean] Flag to enable NA for answer.
233
+ def allow_na
234
+ @properties['allow_na']
235
+ end
236
+
237
+ ##
238
+ # @return [String] The url
239
+ def url
240
+ @properties['url']
241
+ end
242
+
243
+ ##
244
+ # Update the InsightsQuestionnairesQuestionInstance
245
+ # @param [String] question The question.
246
+ # @param [String] description The description for the question.
247
+ # @param [String] answer_set_id The answer_set for the question.
248
+ # @param [Boolean] allow_na The flag to enable for disable NA for answer.
249
+ # @param [String] category_id The ID of the category
250
+ # @param [String] token The Token HTTP request header
251
+ # @return [InsightsQuestionnairesQuestionInstance] Updated InsightsQuestionnairesQuestionInstance
252
+ def update(question: nil, description: nil, answer_set_id: nil, allow_na: nil, category_id: :unset, token: :unset)
253
+ context.update(
254
+ question: question,
255
+ description: description,
256
+ answer_set_id: answer_set_id,
257
+ allow_na: allow_na,
258
+ category_id: category_id,
259
+ token: token,
260
+ )
261
+ end
262
+
263
+ ##
264
+ # Delete the InsightsQuestionnairesQuestionInstance
265
+ # @param [String] token The Token HTTP request header
266
+ # @return [Boolean] true if delete succeeds, false otherwise
267
+ def delete(token: :unset)
268
+ context.delete(token: token, )
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.V1.InsightsQuestionnairesQuestionInstance #{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.V1.InsightsQuestionnairesQuestionInstance #{values}>"
283
+ end
284
+ end
285
+ end
286
+ end
287
+ end
288
+ end