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
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 160 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.
199 200 201 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 199 def account_sid @properties['account_sid'] end |
#agent_id ⇒ String
Returns AgentID.
229 230 231 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 229 def agent_id @properties['agent_id'] end |
#answer_id ⇒ String
Returns Answer Id.
259 260 261 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 259 def answer_id @properties['answer_id'] end |
#answer_text ⇒ String
Returns Answer text.
253 254 255 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 253 def answer_text @properties['answer_text'] end |
#assessment ⇒ Hash
Returns Assessment Details.
265 266 267 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 265 def assessment @properties['assessment'] end |
#assessment_id ⇒ String
Returns Assessment id.
205 206 207 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 205 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
190 191 192 193 194 195 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 190 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
301 302 303 304 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 301 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.AssessmentsInstance #{values}>" end |
#offset ⇒ String
Returns offset.
211 212 213 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 211 def offset @properties['offset'] end |
#report ⇒ Boolean
Returns Part of assessment report.
217 218 219 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 217 def report @properties['report'] end |
#segment_id ⇒ String
Returns Segment Id.
235 236 237 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 235 def segment_id @properties['segment_id'] end |
#timestamp ⇒ String
Returns The timestamp.
271 272 273 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 271 def @properties['timestamp'] end |
#to_s ⇒ Object
Provide a user friendly representation
294 295 296 297 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 294 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
288 289 290 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 288 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.
277 278 279 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 277 def url @properties['url'] end |
#user_email ⇒ String
Returns The user email id.
247 248 249 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 247 def user_email @properties['user_email'] end |
#user_name ⇒ String
Returns The user name.
241 242 243 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 241 def user_name @properties['user_name'] end |
#weight ⇒ String
Returns The weightage.
223 224 225 |
# File 'lib/twilio-ruby/rest/flex_api/v1/assessments.rb', line 223 def weight @properties['weight'] end |