Class: Twilio::REST::Preview::BulkExports::ExportContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/preview/bulk_exports/export.rb,
lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Defined Under Namespace

Classes: DayInstance, DayList, DayPage

Instance Method Summary collapse

Constructor Details

#initialize(version, resource_type) ⇒ ExportContext

Initialize the ExportContext

Parameters:

  • version (Version)

    Version that contains the resource

  • resource_type (String)

    The resource_type



73
74
75
76
77
78
79
80
81
82
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 73

def initialize(version, resource_type)
  super(version)

  # Path Solution
  @solution = {resource_type: resource_type, }
  @uri = "/Exports/#{@solution[:resource_type]}"

  # Dependents
  @days = nil
end

Instance Method Details

#daysDayList, DayContext

Access the days

Returns:



103
104
105
106
107
108
109
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 103

def days
  unless @days
    @days = DayList.new(@version, resource_type: @solution[:resource_type], )
  end

  @days
end

#fetchExportInstance

Fetch a ExportInstance

Returns:



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 87

def fetch
  params = Twilio::Values.of({})

  payload = @version.fetch(
      'GET',
      @uri,
      params,
  )

  ExportInstance.new(@version, payload, resource_type: @solution[:resource_type], )
end

#inspectObject

Provide a detailed, user friendly representation



120
121
122
123
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 120

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.BulkExports.ExportContext #{context}>"
end

#to_sObject

Provide a user friendly representation



113
114
115
116
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 113

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.BulkExports.ExportContext #{context}>"
end