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.



170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 170

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

Returns:



189
190
191
192
193
194
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 189

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

#daysdays

Access the days

Returns:



232
233
234
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 232

def days
    context.days
end

#export_custom_jobsexport_custom_jobs

Access the export_custom_jobs

Returns:



225
226
227
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 225

def export_custom_jobs
    context.export_custom_jobs
end

#fetchExportInstance

Fetch the ExportInstance

Returns:



217
218
219
220
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 217

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



245
246
247
248
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 245

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.



210
211
212
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 210

def links
    @properties['links']
end

#resource_typeString

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

Returns:

  • (String)

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



198
199
200
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 198

def resource_type
    @properties['resource_type']
end

#to_sObject

Provide a user friendly representation



238
239
240
241
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 238

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

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



204
205
206
# File 'lib/twilio-ruby/rest/bulkexports/v1/export.rb', line 204

def url
    @properties['url']
end