Class: Twilio::REST::Insights::V1::AnnotationInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, call_sid: nil) ⇒ AnnotationInstance

Initialize the AnnotationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • call_sid (String) (defaults to: nil)

    The call_sid


132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 132

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_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid


173
174
175
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 173

def 
  @properties['account_sid']
end

#answered_byannotation.AnsweredBy

Returns The answered_by.

Returns:


179
180
181
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 179

def answered_by
  @properties['answered_by']
end

#call_scoreString

Returns The call_score.

Returns:

  • (String)

    The call_score


203
204
205
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 203

def call_score
  @properties['call_score']
end

#call_sidString

Returns The call_sid.

Returns:

  • (String)

    The call_sid


167
168
169
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 167

def call_sid
  @properties['call_sid']
end

#commentString

Returns The comment.

Returns:

  • (String)

    The comment


209
210
211
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 209

def comment
  @properties['comment']
end

#connectivity_issueannotation.ConnectivityIssue

Returns The connectivity_issue.

Returns:

  • (annotation.ConnectivityIssue)

    The connectivity_issue


185
186
187
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 185

def connectivity_issue
  @properties['connectivity_issue']
end

#contextAnnotationContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:


158
159
160
161
162
163
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 158

def context
  unless @instance_context
    @instance_context = AnnotationContext.new(@version, @params['call_sid'], )
  end
  @instance_context
end

#fetchAnnotationInstance

Fetch the AnnotationInstance

Returns:


250
251
252
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 250

def fetch
  context.fetch
end

#incidentString

Returns The incident.

Returns:

  • (String)

    The incident


215
216
217
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 215

def incident
  @properties['incident']
end

#inspectObject

Provide a detailed, user friendly representation


263
264
265
266
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 263

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Insights.V1.AnnotationInstance #{values}>"
end

#quality_issuesArray[String]

Returns The quality_issues.

Returns:

  • (Array[String])

    The quality_issues


191
192
193
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 191

def quality_issues
  @properties['quality_issues']
end

#spamBoolean

Returns The spam.

Returns:

  • (Boolean)

    The spam


197
198
199
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 197

def spam
  @properties['spam']
end

#to_sObject

Provide a user friendly representation


256
257
258
259
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 256

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

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:


235
236
237
238
239
240
241
242
243
244
245
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 235

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

#urlString

Returns The url.

Returns:

  • (String)

    The url


221
222
223
# File 'lib/twilio-ruby/rest/insights/v1/annotation.rb', line 221

def url
  @properties['url']
end