## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / module Twilio module REST class Preview < Domain class BulkExports < Version class ExportList < ListResource ## # Initialize the ExportList # @param [Version] version Version that contains the resource # @return [ExportList] ExportList def initialize(version) super(version) # Path Solution @solution = {} end ## # Provide a user friendly representation def to_s '#' end end class ExportPage < Page ## # Initialize the ExportPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [ExportPage] ExportPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of ExportInstance # @param [Hash] payload Payload response from the API # @return [ExportInstance] ExportInstance def get_instance(payload) ExportInstance.new( @version, payload, ) end ## # Provide a user friendly representation def to_s '' end end class ExportContext < InstanceContext ## # Initialize the ExportContext # @param [Version] version Version that contains the resource # @param [String] resource_type The resource_type # @return [ExportContext] ExportContext def initialize(version, resource_type) super(version) # Path Solution @solution = { resource_type: resource_type, } @uri = "/Exports/#{@solution[:resource_type]}" # Dependents @days = nil end ## # Fetch a ExportInstance # @return [ExportInstance] Fetched ExportInstance def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) ExportInstance.new( @version, payload, resource_type: @solution[:resource_type], ) end ## # Access the days # @return [DayList] DayList def days unless @days @days = DayList.new( @version, resource_type: @solution[:resource_type], ) end @days end ## # Provide a user friendly representation def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end end class ExportInstance < InstanceResource ## # Initialize the ExportInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] resource_type The resource_type # @return [ExportInstance] ExportInstance def initialize(version, payload, resource_type: nil) super(version) # Marshaled Properties @properties = { 'resource_type' => payload['resource_type'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'resource_type' => resource_type || @properties['resource_type'], } 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 [ExportContext] ExportContext for this ExportInstance def context unless @instance_context @instance_context = ExportContext.new( @version, @params['resource_type'], ) end @instance_context end def resource_type @properties['resource_type'] end def url @properties['url'] end def links @properties['links'] end ## # Fetch a ExportInstance # @return [ExportInstance] Fetched ExportInstance def fetch context.fetch end ## # Access the days # @return [days] days def days context.days end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end