## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / module Twilio module REST class Api < Domain class V2010 < Version class AccountContext < InstanceContext class CallList < ListResource class FeedbackSummaryList < ListResource ## # Initialize the FeedbackSummaryList # @param [Version] version Version that contains the resource # @param [String] account_sid The unique id of the Account responsible for # creating this Call # @return [FeedbackSummaryList] FeedbackSummaryList def initialize(version, account_sid: nil) super(version) # Path Solution @solution = { account_sid: account_sid } @uri = "/Accounts/#{@solution[:account_sid]}/Calls/FeedbackSummary.json" end ## # Retrieve a single page of FeedbackSummaryInstance records from the API. # Request is executed immediately. # @param [Date] start_date The start_date # @param [Date] end_date The end_date # @param [Boolean] include_subaccounts The include_subaccounts # @param [String] status_callback The status_callback # @param [String] status_callback_method The status_callback_method # @return [FeedbackSummaryInstance] Newly created FeedbackSummaryInstance def create(start_date: nil, end_date: nil, include_subaccounts: nil, status_callback: nil, status_callback_method: nil) data = { 'StartDate' => Twilio.serialize_iso8601(start_date), 'EndDate' => Twilio.serialize_iso8601(end_date), 'IncludeSubaccounts' => include_subaccounts, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, } payload = @version.create( 'POST', @uri, data: data ) return FeedbackSummaryInstance.new( @version, payload, account_sid: @solution['account_sid'], ) end ## # Constructs a FeedbackSummaryContext # @param [String] sid The sid # @return [FeedbackSummaryContext] FeedbackSummaryContext def get(sid) FeedbackSummaryContext.new( @version, account_sid: @solution[:account_sid], sid: sid, ) end ## # Provide a user friendly representation def to_s '#' end end class FeedbackSummaryPage < Page ## # Initialize the FeedbackSummaryPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @param [String] account_sid The unique id of the Account responsible for # creating this Call # @return [FeedbackSummaryPage] FeedbackSummaryPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of FeedbackSummaryInstance # @param [Hash] payload Payload response from the API # @return [FeedbackSummaryInstance] FeedbackSummaryInstance def get_instance(payload) return FeedbackSummaryInstance.new( @version, payload, account_sid: @solution['account_sid'], ) end ## # Provide a user friendly representation def to_s '' end end class FeedbackSummaryContext < InstanceContext ## # Initialize the FeedbackSummaryContext # @param [Version] version Version that contains the resource # @param [String] account_sid The account_sid # @param [String] sid The sid # @return [FeedbackSummaryContext] FeedbackSummaryContext def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/Calls/FeedbackSummary/#{@solution[:sid]}.json" end ## # Fetch a FeedbackSummaryInstance # @return [FeedbackSummaryInstance] Fetched FeedbackSummaryInstance def fetch params = {} payload = @version.fetch( 'GET', @uri, params, ) return FeedbackSummaryInstance.new( @version, payload, account_sid: @solution['account_sid'], sid: @solution['sid'], ) end ## # Deletes the FeedbackSummaryInstance # @return [Boolean] true if delete succeeds, true otherwise def delete return @version.delete('delete', @uri) end ## # Provide a user friendly representation def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end end class FeedbackSummaryInstance < InstanceResource ## # Initialize the FeedbackSummaryInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The unique id of the Account responsible for # creating this Call # @param [String] sid The sid # @return [FeedbackSummaryInstance] FeedbackSummaryInstance def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'call_count' => payload['call_count'].to_i, 'call_feedback_count' => payload['call_feedback_count'].to_i, 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'end_date' => Twilio.deserialize_iso8601(payload['end_date']), 'include_subaccounts' => payload['include_subaccounts'], 'issues' => payload['issues'], 'quality_score_average' => payload['quality_score_average'].to_f, 'quality_score_median' => payload['quality_score_median'].to_f, 'quality_score_standard_deviation' => payload['quality_score_standard_deviation'].to_f, 'sid' => payload['sid'], 'start_date' => Twilio.deserialize_iso8601(payload['start_date']), 'status' => payload['status'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @param [Version] version Version that contains the resource # @return [FeedbackSummaryContext] FeedbackSummaryContext for this FeedbackSummaryInstance def context unless @instance_context @instance_context = FeedbackSummaryContext.new( @version, @params['account_sid'], @params['sid'], ) end @instance_context end def account_sid @properties['account_sid'] end def call_count @properties['call_count'] end def call_feedback_count @properties['call_feedback_count'] end def date_created @properties['date_created'] end def date_updated @properties['date_updated'] end def end_date @properties['end_date'] end def include_subaccounts @properties['include_subaccounts'] end def issues @properties['issues'] end def quality_score_average @properties['quality_score_average'] end def quality_score_median @properties['quality_score_median'] end def quality_score_standard_deviation @properties['quality_score_standard_deviation'] end def sid @properties['sid'] end def start_date @properties['start_date'] end def status @properties['status'] end ## # Fetch a FeedbackSummaryInstance # @return [FeedbackSummaryInstance] Fetched FeedbackSummaryInstance def fetch @context.fetch() end ## # Deletes the FeedbackSummaryInstance # @return [Boolean] true if delete succeeds, true otherwise def delete @context.delete() end ## # Provide a user friendly representation def to_s context = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end end end