class Twilio::REST::Bulkexports::V1::ExportContext::DayInstance

Public Class Methods

new(version, payload, resource_type: nil, day: nil) click to toggle source

Initialize the DayInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] resource_type The type of communication – Messages, Calls,

Conferences, and Participants

@param [String] day The ISO 8601 format date of the resources in the file, for a

UTC day

@return [DayInstance] DayInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
196 def initialize(version, payload, resource_type: nil, day: nil)
197   super(version)
198 
199   # Marshaled Properties
200   @properties = {
201       'redirect_to' => payload['redirect_to'],
202       'day' => payload['day'],
203       'size' => payload['size'].to_i,
204       'create_date' => payload['create_date'],
205       'friendly_name' => payload['friendly_name'],
206       'resource_type' => payload['resource_type'],
207   }
208 
209   # Context
210   @instance_context = nil
211   @params = {'resource_type' => resource_type, 'day' => day || @properties['day'], }
212 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [DayContext] DayContext for this DayInstance

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
218 def context
219   unless @instance_context
220     @instance_context = DayContext.new(@version, @params['resource_type'], @params['day'], )
221   end
222   @instance_context
223 end
create_date() click to toggle source

@return [String] The date when resource is created

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
245 def create_date
246   @properties['create_date']
247 end
day() click to toggle source

@return [String] The date of the data in the file

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
233 def day
234   @properties['day']
235 end
fetch() click to toggle source

Fetch the DayInstance @return [DayInstance] Fetched DayInstance

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
264 def fetch
265   context.fetch
266 end
friendly_name() click to toggle source

@return [String] The friendly name specified when creating the job

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
251 def friendly_name
252   @properties['friendly_name']
253 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
277 def inspect
278   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
279   "<Twilio.Bulkexports.V1.DayInstance #{values}>"
280 end
redirect_to() click to toggle source

@return [String] The redirect_to

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
227 def redirect_to
228   @properties['redirect_to']
229 end
resource_type() click to toggle source

@return [String] The type of communication – Messages, Calls, Conferences, and Participants

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
257 def resource_type
258   @properties['resource_type']
259 end
size() click to toggle source

@return [String] Size of the file in bytes

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
239 def size
240   @properties['size']
241 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/bulkexports/v1/export/day.rb
270 def to_s
271   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
272   "<Twilio.Bulkexports.V1.DayInstance #{values}>"
273 end