Class: Twilio::REST::Insights::V1::CallContext::AnnotationContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Insights::V1::CallContext::AnnotationContext
- Defined in:
- lib/twilio-ruby/rest/insights/v1/call/annotation.rb
Instance Method Summary collapse
-
#fetch ⇒ AnnotationInstance
Fetch the AnnotationInstance.
-
#initialize(version, call_sid) ⇒ AnnotationContext
constructor
Initialize the AnnotationContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#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.
Constructor Details
#initialize(version, call_sid) ⇒ AnnotationContext
Initialize the AnnotationContext
51 52 53 54 55 56 57 58 59 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 51 def initialize(version, call_sid) super(version) # Path Solution @solution = { call_sid: call_sid, } @uri = "/Voice/#{@solution[:call_sid]}/Annotation" end |
Instance Method Details
#fetch ⇒ AnnotationInstance
Fetch the AnnotationInstance
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 63 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) AnnotationInstance.new( @version, payload, call_sid: @solution[:call_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
133 134 135 136 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 133 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.AnnotationContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
126 127 128 129 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 126 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.AnnotationContext #{context}>" end |
#update(answered_by: :unset, connectivity_issue: :unset, quality_issues: :unset, spam: :unset, call_score: :unset, comment: :unset, incident: :unset) ⇒ AnnotationInstance
Update the AnnotationInstance
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/twilio-ruby/rest/insights/v1/call/annotation.rb', line 89 def update( answered_by: :unset, connectivity_issue: :unset, quality_issues: :unset, spam: :unset, call_score: :unset, comment: :unset, incident: :unset ) data = Twilio::Values.of({ 'AnsweredBy' => answered_by, 'ConnectivityIssue' => connectivity_issue, 'QualityIssues' => quality_issues, 'Spam' => spam, 'CallScore' => call_score, 'Comment' => comment, 'Incident' => incident, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) AnnotationInstance.new( @version, payload, call_sid: @solution[:call_sid], ) end |