Class: Twilio::REST::Api::V2010::AccountContext::MessageContext::FeedbackList

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

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid: nil, message_sid: nil) ⇒ FeedbackList

Initialize the FeedbackList

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created the MessageFeedback resource.

  • message_sid (String) (defaults to: nil)

    The SID of the Message resource for which the feedback was provided.


25
26
27
28
29
30
31
# File 'lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb', line 25

def initialize(version, account_sid: nil, message_sid: nil)
  super(version)

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

Instance Method Details

#create(outcome: :unset) ⇒ FeedbackInstance

Create the FeedbackInstance

Parameters:

  • outcome (feedback.Outcome) (defaults to: :unset)

    Whether the feedback has arrived. Can be: `unconfirmed` or `confirmed`. If `provide_feedback`=`true` in the initial HTTP POST, the initial value of this property is `unconfirmed`. After the message arrives, update the value to `confirmed`.

Returns:


41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb', line 41

def create(outcome: :unset)
  data = Twilio::Values.of({'Outcome' => outcome, })

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

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

#to_sObject

Provide a user friendly representation


56
57
58
# File 'lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb', line 56

def to_s
  '#<Twilio.Api.V2010.FeedbackList>'
end