Class: Twilio::REST::Insights::V1::AnnotationContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/insights/v1/annotation.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, call_sid) ⇒ AnnotationContext

Initialize the AnnotationContext

Parameters:

  • version (Version)

    Version that contains the resource

  • call_sid (String)

    The call_sid


67
68
69
70
71
72
73
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 67

def initialize(version, call_sid)
  super(version)

  # Path Solution
  @solution = {call_sid: call_sid, }
  @uri = "/Voice/#{@solution[:call_sid]}/Annotation"
end

Instance Method Details

#fetchAnnotationInstance

Fetch the AnnotationInstance

Returns:


104
105
106
107
108
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 104

def fetch
  payload = @version.fetch('GET', @uri)

  AnnotationInstance.new(@version, payload, call_sid: @solution[:call_sid], )
end

#inspectObject

Provide a detailed, user friendly representation


119
120
121
122
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 119

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

#to_sObject

Provide a user friendly representation


112
113
114
115
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 112

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

Parameters:

  • answered_by (annotation.AnsweredBy) (defaults to: :unset)

    The answered_by

  • connectivity_issue (annotation.ConnectivityIssue) (defaults to: :unset)

    The connectivity_issue

  • quality_issues (String) (defaults to: :unset)

    The quality_issues

  • spam (Boolean) (defaults to: :unset)

    The spam

  • call_score (String) (defaults to: :unset)

    The call_score

  • comment (String) (defaults to: :unset)

    The comment

  • incident (String) (defaults to: :unset)

    The incident

Returns:


85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 85

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,
  })

  payload = @version.update('POST', @uri, data: data)

  AnnotationInstance.new(@version, payload, call_sid: @solution[:call_sid], )
end