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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, call_sid: nil) ⇒ FeedbackInstance

Initialize the FeedbackInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The unique id of the Account responsible for this resource.

  • call_sid (String) (defaults to: nil)

    The unique string that we created to identify this Call resource.


182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 182

def initialize(version, payload, account_sid: nil, call_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
      'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
      'issues' => payload['issues'],
      'quality_score' => payload['quality_score'].to_i,
      'sid' => payload['sid'],
  }

  # Context
  @instance_context = nil
  @params = {'account_sid' => , 'call_sid' => call_sid, }
end

Instance Method Details

#account_sidString

Returns The unique sid that identifies this account.

Returns:

  • (String)

    The unique sid that identifies this account


213
214
215
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 213

def 
  @properties['account_sid']
end

#contextFeedbackContext

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

Returns:


204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 204

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

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

Create 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 (Array[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:


264
265
266
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 264

def create(quality_score: nil, issue: :unset)
  context.create(quality_score: quality_score, issue: issue, )
end

#date_createdTime

Returns The date this resource was created.

Returns:

  • (Time)

    The date this resource was created


219
220
221
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 219

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this resource was last updated.

Returns:

  • (Time)

    The date this resource was last updated


225
226
227
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 225

def date_updated
  @properties['date_updated']
end

#fetchFeedbackInstance

Fetch the FeedbackInstance

Returns:


250
251
252
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 250

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


291
292
293
294
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 291

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

#issuesArray[feedback.Issues]

Returns Issues experienced during the call.

Returns:

  • (Array[feedback.Issues])

    Issues experienced during the call


231
232
233
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 231

def issues
  @properties['issues']
end

#quality_scoreString

Returns 1 to 5 quality score.

Returns:

  • (String)

    1 to 5 quality score


237
238
239
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 237

def quality_score
  @properties['quality_score']
end

#sidString

Returns A string that uniquely identifies this feedback resource.

Returns:

  • (String)

    A string that uniquely identifies this feedback resource


243
244
245
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 243

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


284
285
286
287
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 284

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Api.V2010.FeedbackInstance #{values}>"
end

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

Update the FeedbackInstance

Parameters:

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

    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 (Array[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:


278
279
280
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 278

def update(quality_score: :unset, issue: :unset)
  context.update(quality_score: quality_score, issue: issue, )
end