## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Voice < Domain class V1 < Version ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class ArchivedCallList < ListResource ## # Initialize the ArchivedCallList # @param [Version] version Version that contains the resource # @return [ArchivedCallList] ArchivedCallList def initialize(version) super(version) # Path Solution @solution = {} end ## # Provide a user friendly representation def to_s '#' end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class ArchivedCallPage < Page ## # Initialize the ArchivedCallPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [ArchivedCallPage] ArchivedCallPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of ArchivedCallInstance # @param [Hash] payload Payload response from the API # @return [ArchivedCallInstance] ArchivedCallInstance def get_instance(payload) ArchivedCallInstance.new(@version, payload, ) end ## # Provide a user friendly representation def to_s '' end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class ArchivedCallContext < InstanceContext ## # Initialize the ArchivedCallContext # @param [Version] version Version that contains the resource # @param [Date] date The date of the Call in UTC. # @param [String] sid The Twilio-provided Call SID that uniquely identifies the # Call resource to delete # @return [ArchivedCallContext] ArchivedCallContext def initialize(version, date, sid) super(version) # Path Solution @solution = {date: date, sid: sid, } @uri = "/Archives/#{@solution[:date]}/Calls/#{@solution[:sid]}" end ## # Delete the ArchivedCallInstance # @return [Boolean] true if delete succeeds, false otherwise def delete @version.delete('DELETE', @uri) end ## # Provide a user friendly representation def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class ArchivedCallInstance < InstanceResource ## # Initialize the ArchivedCallInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [Date] date The date of the Call in UTC. # @param [String] sid The Twilio-provided Call SID that uniquely identifies the # Call resource to delete # @return [ArchivedCallInstance] ArchivedCallInstance def initialize(version, payload, date: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'date' => Twilio.deserialize_iso8601_date(payload['date']), 'sid' => payload['sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'date' => date || @properties['date'], '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 # @return [ArchivedCallContext] ArchivedCallContext for this ArchivedCallInstance def context unless @instance_context @instance_context = ArchivedCallContext.new(@version, @params['date'], @params['sid'], ) end @instance_context end ## # @return [Date] date def date @properties['date'] end ## # @return [String] sid def sid @properties['sid'] end ## # @return [String] The absolute URL of the resource def url @properties['url'] end ## # Delete the ArchivedCallInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end ## # Provide a detailed, user friendly representation def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end