Class: Twilio::REST::FlexApi::V1::InsightsQuestionnairesQuestionContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, question_sid) ⇒ InsightsQuestionnairesQuestionContext

Initialize the InsightsQuestionnairesQuestionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • question_sid (String)

    The SID of the question



188
189
190
191
192
193
194
195
196
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 188

def initialize(version, question_sid)
    super(version)

    # Path Solution
    @solution = { question_sid: question_sid,  }
    @uri = "/Insights/QualityManagement/Questions/#{@solution[:question_sid]}"

    
end

Instance Method Details

#delete(authorization: :unset) ⇒ Boolean

Delete the InsightsQuestionnairesQuestionInstance

Parameters:

  • authorization (String) (defaults to: :unset)

    The Authorization HTTP request header

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



201
202
203
204
205
206
207
208
209
210
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 201

def delete(
    authorization: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#inspectObject

Provide a detailed, user friendly representation



262
263
264
265
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 262

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.InsightsQuestionnairesQuestionContext #{context}>"
end

#to_sObject

Provide a user friendly representation



255
256
257
258
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 255

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.InsightsQuestionnairesQuestionContext #{context}>"
end

#update(allow_na: nil, category_sid: :unset, question: :unset, description: :unset, answer_set_id: :unset, authorization: :unset) ⇒ InsightsQuestionnairesQuestionInstance

Update the InsightsQuestionnairesQuestionInstance

Parameters:

  • allow_na (Boolean) (defaults to: nil)

    The flag to enable for disable NA for answer.

  • category_sid (String) (defaults to: :unset)

    The SID of the category

  • question (String) (defaults to: :unset)

    The question.

  • description (String) (defaults to: :unset)

    The description for the question.

  • answer_set_id (String) (defaults to: :unset)

    The answer_set for the question.

  • authorization (String) (defaults to: :unset)

    The Authorization HTTP request header

Returns:



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 221

def update(
    allow_na: nil, 
    category_sid: :unset, 
    question: :unset, 
    description: :unset, 
    answer_set_id: :unset, 
    authorization: :unset
)

    data = Twilio::Values.of({
        'AllowNa' => allow_na,
        'CategorySid' => category_sid,
        'Question' => question,
        'Description' => description,
        'AnswerSetId' => answer_set_id,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    InsightsQuestionnairesQuestionInstance.new(
        @version,
        payload,
        question_sid: @solution[:question_sid],
    )
end