## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Twilio - Api # This is the public Twilio REST API. # # NOTE: This class is auto generated by OpenAPI Generator. # https://openapi-generator.tech # Do not edit the class manually. # module Twilio module REST class Api < ApiBase class V2010 < Version class AccountContext < InstanceContext class MessageContext < InstanceContext class FeedbackList < ListResource ## # Initialize the FeedbackList # @param [Version] version Version that contains the resource # @return [FeedbackList] FeedbackList def initialize(version, account_sid: nil, message_sid: nil) super(version) # Path Solution @solution = { account_sid: account_sid, message_sid: message_sid } @uri = "/Accounts/#{@solution[:account_sid]}/Messages/#{@solution[:message_sid]}/Feedback.json" end ## # Create the FeedbackInstance # @param [Outcome] outcome # @return [FeedbackInstance] Created FeedbackInstance 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 # Provide a user friendly representation def to_s '#' end end class FeedbackPage < Page ## # Initialize the FeedbackPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [FeedbackPage] FeedbackPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of FeedbackInstance # @param [Hash] payload Payload response from the API # @return [FeedbackInstance] FeedbackInstance def get_instance(payload) FeedbackInstance.new(@version, payload, account_sid: @solution[:account_sid], message_sid: @solution[:message_sid]) end ## # Provide a user friendly representation def to_s '' end end class FeedbackInstance < InstanceResource ## # Initialize the FeedbackInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The SID of the # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Feedback # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [FeedbackInstance] FeedbackInstance def initialize(version, payload , account_sid: nil, message_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'message_sid' => payload['message_sid'], 'outcome' => payload['outcome'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'uri' => payload['uri'], } end ## # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with this MessageFeedback resource. def account_sid @properties['account_sid'] end ## # @return [String] The SID of the Message resource associated with this MessageFeedback resource. def message_sid @properties['message_sid'] end ## # @return [Outcome] def outcome @properties['outcome'] end ## # @return [Time] The date and time in GMT when this MessageFeedback resource was created, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. def date_created @properties['date_created'] end ## # @return [Time] The date and time in GMT when this MessageFeedback resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. def date_updated @properties['date_updated'] end ## # @return [String] The URI of the resource, relative to `https://api.twilio.com`. def uri @properties['uri'] end ## # Provide a user friendly representation def to_s "" end ## # Provide a detailed, user friendly representation def inspect "" end end end end end end end end