Class: Twilio::REST::Bulkexports::V1::ExportInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/bulkexports/v1/export.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, resource_type: nil) ⇒ ExportInstance

Initialize the ExportInstance



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 312

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

Instance Method Details

#contextExportContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



332
333
334
335
336
337
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 332

def context
    unless @instance_context
        @instance_context = ExportContext.new(@version , @params['resource_type'])
    end
    @instance_context
end

#daysdays

Access the days



375
376
377
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 375

def days
    context.days
end

#export_custom_jobsexport_custom_jobs

Access the export_custom_jobs



368
369
370
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 368

def export_custom_jobs
    context.export_custom_jobs
end

#fetchExportInstance

Fetch the ExportInstance



360
361
362
363
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 360

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



388
389
390
391
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 388

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Bulkexports.V1.ExportInstance #{values}>"
end


353
354
355
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 353

def links
    @properties['links']
end

#resource_typeString



341
342
343
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 341

def resource_type
    @properties['resource_type']
end

#to_sObject

Provide a user friendly representation



381
382
383
384
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 381

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Bulkexports.V1.ExportInstance #{values}>"
end

#urlString



347
348
349
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 347

def url
    @properties['url']
end