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

Inherits:
InstanceContext
  • Object
show all
Defined in:
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]

Instance Method Summary collapse

Constructor Details

#initialize(version, resource_type, day) ⇒ DayContext

Initialize the DayContext

Parameters:

  • version (Version)

    Version that contains the resource

  • resource_type (String)

    The type of communication – Messages, Calls, Conferences, and Participants

  • day (String)

    The ISO 8601 format date of the resources in the file, for a UTC day


160
161
162
163
164
165
166
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 160

def initialize(version, resource_type, day)
  super(version)

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

Instance Method Details

#fetchDayInstance

Fetch the DayInstance

Returns:


171
172
173
174
175
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 171

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

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

#inspectObject

Provide a detailed, user friendly representation


186
187
188
189
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 186

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

#to_sObject

Provide a user friendly representation


179
180
181
182
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 179

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