Class: Twilio::REST::Bulkexports::V1::ExportContext::DayInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, resource_type: nil, day: nil) ⇒ DayInstance

Initialize the DayInstance



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 380

def initialize(version, payload , resource_type: nil, day: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'redirect_to' => payload['redirect_to'],
        'day' => payload['day'],
        'size' => payload['size'] == nil ? payload['size'] : payload['size'].to_i,
        'create_date' => payload['create_date'],
        'friendly_name' => payload['friendly_name'],
        'resource_type' => payload['resource_type'],
    }

    # Context
    @instance_context = nil
    @params = { 'resource_type' => resource_type  || @properties['resource_type']  ,'day' => day  || @properties['day']  , }
end

Instance Method Details

#contextDayContext

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



403
404
405
406
407
408
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 403

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

#create_dateString



430
431
432
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 430

def create_date
    @properties['create_date']
end

#dayString



418
419
420
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 418

def day
    @properties['day']
end

#fetchDayInstance

Fetch the DayInstance



449
450
451
452
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 449

def fetch

    context.fetch
end

#friendly_nameString



436
437
438
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 436

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



463
464
465
466
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 463

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

#redirect_toString



412
413
414
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 412

def redirect_to
    @properties['redirect_to']
end

#resource_typeString



442
443
444
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 442

def resource_type
    @properties['resource_type']
end

#sizeString



424
425
426
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 424

def size
    @properties['size']
end

#to_sObject

Provide a user friendly representation



456
457
458
459
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 456

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