Class: Twilio::REST::Bulkexports::V1::ExportInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/bulkexports/v1/export.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) ⇒ ExportInstance

Initialize the ExportInstance



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

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



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

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

#daysdays

Access the days



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

def days
  context.days
end

#export_custom_jobsexport_custom_jobs

Access the export_custom_jobs



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

def export_custom_jobs
  context.export_custom_jobs
end

#fetchExportInstance

Fetch the ExportInstance



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

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

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


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

def links
  @properties['links']
end

#resource_typeString



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

def resource_type
  @properties['resource_type']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString



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

def url
  @properties['url']
end