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

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

Overview

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 [email protected].

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



181
182
183
184
185
186
187
188
189
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 181

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



194
195
196
197
198
199
200
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 194

def delete(
    authorization: :unset
)

    headers = Twilio::Values.of({ 'Authorization' => authorization, })
    @version.delete('DELETE', @uri, headers: headers)
end

#inspectObject

Provide a detailed, user friendly representation



247
248
249
250
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 247

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

#to_sObject

Provide a user friendly representation



240
241
242
243
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 240

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:



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb', line 211

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({ 'Authorization' => authorization, })
    payload = @version.update('POST', @uri, data: data, headers: headers)
    InsightsQuestionnairesQuestionInstance.new(
        @version,
        payload,
        question_sid: @solution[:question_sid],
    )
end