Class: Twilio::REST::FlexApi::V1::AssessmentsInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::FlexApi::V1::AssessmentsInstance
- Defined in:
- lib/twilio-ruby/rest/flex_api/v1/assessments.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
-
#account_sid ⇒ String
Account Sid.
-
#agent_id ⇒ String
AgentID.
-
#answer_id ⇒ String
Answer Id.
-
#answer_text ⇒ String
Answer text.
-
#assessment ⇒ Hash
Assessment Details.
-
#assessment_id ⇒ String
Assessment id.
-
#context ⇒ AssessmentsContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#initialize(version, payload, assessment_id: nil) ⇒ AssessmentsInstance
constructor
Initialize the AssessmentsInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#offset ⇒ String
Offset.
-
#report ⇒ Boolean
Part of assessment report.
-
#segment_id ⇒ String
Segment Id.
-
#timestamp ⇒ String
The timestamp.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(offset: nil, answer_text: nil, answer_id: nil, token: :unset) ⇒ AssessmentsInstance
Update the AssessmentsInstance.
-
#url ⇒ String
The url.
-
#user_email ⇒ String
The user email id.
-
#user_name ⇒ String
The user name.
-
#weight ⇒ String
The weightage.
Constructor Details
#initialize(version, payload, assessment_id: nil) ⇒ AssessmentsInstance
Initialize the AssessmentsInstance
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 248 def initialize(version, payload, assessment_id: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'assessment_id' => payload['assessment_id'], 'offset' => payload['offset'] == nil ? payload['offset'] : payload['offset'].to_f, 'report' => payload['report'], 'weight' => payload['weight'] == nil ? payload['weight'] : payload['weight'].to_f, 'agent_id' => payload['agent_id'], 'segment_id' => payload['segment_id'], 'user_name' => payload['user_name'], 'user_email' => payload['user_email'], 'answer_text' => payload['answer_text'], 'answer_id' => payload['answer_id'], 'assessment' => payload['assessment'], 'timestamp' => payload['timestamp'] == nil ? payload['timestamp'] : payload['timestamp'].to_f, 'url' => payload['url'], } # Context @instance_context = nil @params = {'assessment_id' => assessment_id || @properties['assessment_id'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
287 288 289 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 287 def account_sid @properties['account_sid'] end |
#agent_id ⇒ String
Returns AgentID.
317 318 319 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 317 def agent_id @properties['agent_id'] end |
#answer_id ⇒ String
Returns Answer Id.
347 348 349 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 347 def answer_id @properties['answer_id'] end |
#answer_text ⇒ String
Returns Answer text.
341 342 343 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 341 def answer_text @properties['answer_text'] end |
#assessment ⇒ Hash
Returns Assessment Details.
353 354 355 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 353 def assessment @properties['assessment'] end |
#assessment_id ⇒ String
Returns Assessment id.
293 294 295 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 293 def assessment_id @properties['assessment_id'] end |
#context ⇒ AssessmentsContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
278 279 280 281 282 283 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 278 def context unless @instance_context @instance_context = AssessmentsContext.new(@version, @params['assessment_id'], ) end @instance_context end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
389 390 391 392 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 389 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.AssessmentsInstance #{values}>" end |
#offset ⇒ String
Returns offset.
299 300 301 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 299 def offset @properties['offset'] end |
#report ⇒ Boolean
Returns Part of assessment report.
305 306 307 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 305 def report @properties['report'] end |
#segment_id ⇒ String
Returns Segment Id.
323 324 325 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 323 def segment_id @properties['segment_id'] end |
#timestamp ⇒ String
Returns The timestamp.
359 360 361 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 359 def @properties['timestamp'] end |
#to_s ⇒ Object
Provide a user friendly representation
382 383 384 385 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 382 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.AssessmentsInstance #{values}>" end |
#update(offset: nil, answer_text: nil, answer_id: nil, token: :unset) ⇒ AssessmentsInstance
Update the AssessmentsInstance
376 377 378 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 376 def update(offset: nil, answer_text: nil, answer_id: nil, token: :unset) context.update(offset: offset, answer_text: answer_text, answer_id: answer_id, token: token, ) end |
#url ⇒ String
Returns The url.
365 366 367 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 365 def url @properties['url'] end |
#user_email ⇒ String
Returns The user email id.
335 336 337 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 335 def user_email @properties['user_email'] end |
#user_name ⇒ String
Returns The user name.
329 330 331 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 329 def user_name @properties['user_name'] end |
#weight ⇒ String
Returns The weightage.
311 312 313 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 311 def weight @properties['weight'] end |