Class: Twilio::REST::Preview::BulkExports::ExportInstance

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

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

  • resource_type (String) (defaults to: nil)

    The type of communication – Messages, Calls



166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 166

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:



185
186
187
188
189
190
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 185

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

#daysdays

Access the days

Returns:



220
221
222
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 220

def days
  context.days
end

#export_custom_jobsexport_custom_jobs

Access the export_custom_jobs

Returns:



227
228
229
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 227

def export_custom_jobs
  context.export_custom_jobs
end

#fetchExportInstance

Fetch the ExportInstance

Returns:



213
214
215
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 213

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



240
241
242
243
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 240

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

Returns Nested resource URLs.

Returns:

  • (String)

    Nested resource URLs.



206
207
208
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 206

def links
  @properties['links']
end

#resource_typeString

Returns The type of communication – Messages, Calls.

Returns:

  • (String)

    The type of communication – Messages, Calls



194
195
196
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 194

def resource_type
  @properties['resource_type']
end

#to_sObject

Provide a user friendly representation



233
234
235
236
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 233

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

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



200
201
202
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 200

def url
  @properties['url']
end