Class: Twilio::REST::Api::V2010::AccountContext::MessageContext::FeedbackList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Api::V2010::AccountContext::MessageContext::FeedbackList
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb
Instance Method Summary collapse
-
#create(outcome: :unset) ⇒ FeedbackInstance
Create the FeedbackInstance.
-
#create_with_metadata(outcome: :unset) ⇒ FeedbackInstance
Create the FeedbackInstanceMetadata.
-
#initialize(version, account_sid: nil, message_sid: nil) ⇒ FeedbackList
constructor
Initialize the FeedbackList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, account_sid: nil, message_sid: nil) ⇒ FeedbackList
Initialize the FeedbackList
29 30 31 32 33 34 35 36 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb', line 29 def initialize(version, account_sid: nil, message_sid: nil) super(version) # Path Solution @solution = { account_sid: account_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
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb', line 41 def create( outcome: :unset ) data = Twilio::Values.of({ 'Outcome' => outcome, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, data: data, headers: headers) FeedbackInstance.new( @version, payload, account_sid: @solution[:account_sid], message_sid: @solution[:message_sid], ) end |
#create_with_metadata(outcome: :unset) ⇒ FeedbackInstance
Create the FeedbackInstanceMetadata
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb', line 68 def ( outcome: :unset ) data = Twilio::Values.of({ 'Outcome' => outcome, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) feedback_instance = FeedbackInstance.new( @version, response.body, account_sid: @solution[:account_sid], message_sid: @solution[:message_sid], ) FeedbackInstanceMetadata.new( @version, feedback_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
101 102 103 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb', line 101 def to_s '#<Twilio.Api.V2010.FeedbackList>' end |