Class: Twilio::REST::Api::V2010::AccountContext::CallContext::FeedbackContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, call_sid) ⇒ FeedbackContext

Initialize the FeedbackContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The unique id of the [Account](www.twilio.com/docs/api/rest/account) responsible for this resource.

  • call_sid (String)

    The call sid that uniquely identifies the call



82
83
84
85
86
87
88
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 82

def initialize(version, , call_sid)
  super(version)

  # Path Solution
  @solution = {account_sid: , call_sid: call_sid, }
  @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Feedback.json"
end

Instance Method Details

#create(quality_score: nil, issue: :unset) ⇒ FeedbackInstance

Retrieve a single page of FeedbackInstance records from the API. Request is executed immediately.

Parameters:

  • quality_score (String) (defaults to: nil)

    The call quality expressed as an integer from ‘1` to `5` where `1` represents very poor call quality and `5` represents a perfect call.

  • issue (feedback.Issues) (defaults to: :unset)

    A list of one or more issues experienced during the call. Issues can be: ‘imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`.

Returns:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 101

def create(quality_score: nil, issue: :unset)
  data = Twilio::Values.of({
      'QualityScore' => quality_score,
      'Issue' => Twilio.serialize_list(issue) { |e| e },
  })

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

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

#fetchFeedbackInstance

Fetch a FeedbackInstance

Returns:



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 124

def fetch
  params = Twilio::Values.of({})

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

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

#inspectObject

Provide a detailed, user friendly representation



180
181
182
183
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 180

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

#to_sObject

Provide a user friendly representation



173
174
175
176
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 173

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Api.V2010.FeedbackContext #{context}>"
end

#update(quality_score: nil, issue: :unset) ⇒ FeedbackInstance

Update the FeedbackInstance

Parameters:

  • quality_score (String) (defaults to: nil)

    The call quality expressed as an integer from ‘1` to `5` where `1` represents very poor call quality and `5` represents a perfect call.

  • issue (feedback.Issues) (defaults to: :unset)

    One or more issues experienced during the call. The issues can be: ‘imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`.

Returns:



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 151

def update(quality_score: nil, issue: :unset)
  data = Twilio::Values.of({
      'QualityScore' => quality_score,
      'Issue' => Twilio.serialize_list(issue) { |e| e },
  })

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

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