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

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

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

Initialize the DayInstance



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 218

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'].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, '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



240
241
242
243
244
245
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 240

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

#create_dateString



267
268
269
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 267

def create_date
  @properties['create_date']
end

#dayString



255
256
257
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 255

def day
  @properties['day']
end

#fetchDayInstance

Fetch the DayInstance



286
287
288
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 286

def fetch
  context.fetch
end

#friendly_nameString



273
274
275
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 273

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



299
300
301
302
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 299

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

#redirect_toString



249
250
251
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 249

def redirect_to
  @properties['redirect_to']
end

#resource_typeString



279
280
281
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 279

def resource_type
  @properties['resource_type']
end

#sizeString



261
262
263
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 261

def size
  @properties['size']
end

#to_sObject

Provide a user friendly representation



292
293
294
295
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/day.rb', line 292

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