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/iam/api/account) responsible for this resource.

  • call_sid (String)

    The call sid that uniquely identifies the call



52
53
54
55
56
57
58
59
60
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 52

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

#fetchFeedbackInstance

Fetch the FeedbackInstance

Returns:



64
65
66
67
68
69
70
71
72
73
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 64

def fetch

    payload = @version.fetch('GET', @uri)
    FeedbackInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        call_sid: @solution[:call_sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



109
110
111
112
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 109

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

#to_sObject

Provide a user friendly representation



102
103
104
105
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 102

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.FeedbackContext #{context}>"
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[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:



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb', line 80

def update(
    quality_score: :unset, 
    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