Class: Twilio::REST::Insights::V1::CallContext::AnnotationInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Insights::V1::CallContext::AnnotationInstance
- Defined in:
- lib/twilio-ruby/rest/insights/v1/call/annotation.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account.
- #answered_by ⇒ AnsweredBy
-
#call_score ⇒ String
Specifies the Call Score, if available.
-
#call_sid ⇒ String
The unique SID identifier of the Call.
-
#comment ⇒ String
Specifies any comments pertaining to the call.
- #connectivity_issue ⇒ ConnectivityIssue
-
#context ⇒ AnnotationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ AnnotationInstance
Fetch the AnnotationInstance.
-
#incident ⇒ String
Incident or support ticket associated with this call.
-
#initialize(version, payload, call_sid: nil) ⇒ AnnotationInstance
constructor
Initialize the AnnotationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#quality_issues ⇒ Array<String>
Specifies if the call had any subjective quality issues.
-
#spam ⇒ Boolean
Specifies if the call was a spam call.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(answered_by: :unset, connectivity_issue: :unset, quality_issues: :unset, spam: :unset, call_score: :unset, comment: :unset, incident: :unset) ⇒ AnnotationInstance
Update the AnnotationInstance.
- #url ⇒ String
Constructor Details
#initialize(version, payload, call_sid: nil) ⇒ AnnotationInstance
Initialize the AnnotationInstance
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 177 def initialize(version, payload , call_sid: nil) super(version) # Marshaled Properties @properties = { 'call_sid' => payload['call_sid'], 'account_sid' => payload['account_sid'], 'answered_by' => payload['answered_by'], 'connectivity_issue' => payload['connectivity_issue'], 'quality_issues' => payload['quality_issues'], 'spam' => payload['spam'], 'call_score' => payload['call_score'] == nil ? payload['call_score'] : payload['call_score'].to_i, 'comment' => payload['comment'], 'incident' => payload['incident'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'call_sid' => call_sid || @properties['call_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account.
218 219 220 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 218 def account_sid @properties['account_sid'] end |
#answered_by ⇒ AnsweredBy
224 225 226 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 224 def answered_by @properties['answered_by'] end |
#call_score ⇒ String
Returns Specifies the Call Score, if available. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad].
248 249 250 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 248 def call_score @properties['call_score'] end |
#call_sid ⇒ String
Returns The unique SID identifier of the Call.
212 213 214 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 212 def call_sid @properties['call_sid'] end |
#comment ⇒ String
Returns Specifies any comments pertaining to the call. Twilio does not treat this field as PII, so no PII should be included in comments.
254 255 256 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 254 def comment @properties['comment'] end |
#connectivity_issue ⇒ ConnectivityIssue
230 231 232 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 230 def connectivity_issue @properties['connectivity_issue'] end |
#context ⇒ AnnotationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
203 204 205 206 207 208 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 203 def context unless @instance_context @instance_context = AnnotationContext.new(@version , @params['call_sid']) end @instance_context end |
#fetch ⇒ AnnotationInstance
Fetch the AnnotationInstance
273 274 275 276 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 273 def fetch context.fetch end |
#incident ⇒ String
Returns Incident or support ticket associated with this call. The ‘incident` property is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`.
260 261 262 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 260 def incident @properties['incident'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
318 319 320 321 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 318 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.AnnotationInstance #{values}>" end |
#quality_issues ⇒ Array<String>
Returns Specifies if the call had any subjective quality issues. Possible values are one or more of ‘no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, or `static_noise`.
236 237 238 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 236 def quality_issues @properties['quality_issues'] end |
#spam ⇒ Boolean
Returns Specifies if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Is of type Boolean: true, false. Use true if the call was a spam call.
242 243 244 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 242 def spam @properties['spam'] end |
#to_s ⇒ Object
Provide a user friendly representation
311 312 313 314 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 311 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V1.AnnotationInstance #{values}>" end |
#update(answered_by: :unset, connectivity_issue: :unset, quality_issues: :unset, spam: :unset, call_score: :unset, comment: :unset, incident: :unset) ⇒ AnnotationInstance
Update the AnnotationInstance
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 288 def update( answered_by: :unset, connectivity_issue: :unset, quality_issues: :unset, spam: :unset, call_score: :unset, comment: :unset, incident: :unset ) context.update( answered_by: answered_by, connectivity_issue: connectivity_issue, quality_issues: quality_issues, spam: spam, call_score: call_score, comment: comment, incident: incident, ) end |
#url ⇒ String
266 267 268 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 266 def url @properties['url'] end |