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

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this Export resource.

  • sid (String) —

    The SID of the Call resource to fetch.



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 253

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

#context ⇒ ExportContext

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

Returns:



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

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

#days ⇒ days

Access the days

Returns:



316
317
318
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 316

def days
    context.days
end

#export_custom_jobs ⇒ export_custom_jobs

Access the export_custom_jobs

Returns:



309
310
311
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 309

def export_custom_jobs
    context.export_custom_jobs
end

#fetch ⇒ ExportInstance

Fetch the ExportInstance

Returns:



301
302
303
304
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 301

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



329
330
331
332
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 329

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

Returns Contains a dictionary of URL links to nested resources of this Export.

Returns:

  • (Hash) —

    Contains a dictionary of URL links to nested resources of this Export.



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

def links
    @properties['links']
end

#resource_type ⇒ String

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

Returns:

  • (String) —

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



282
283
284
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 282

def resource_type
    @properties['resource_type']
end

#to_s ⇒ Object

Provide a user friendly representation



322
323
324
325
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 322

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

#url ⇒ String

Returns The URL of this resource.

Returns:

  • (String) —

    The URL of this resource.



288
289
290
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 288

def url
    @properties['url']
end