Class: Twilio::REST::Bulkexports::V1::ExportList::JobContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, job_sid) ⇒ JobContext

Initialize the JobContext

Parameters:

  • version (Version)

    Version that contains the resource

  • job_sid (String)

    The unique string that that we created to identify the Bulk Export job


69
70
71
72
73
74
75
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 69

def initialize(version, job_sid)
  super(version)

  # Path Solution
  @solution = {job_sid: job_sid, }
  @uri = "/Exports/Jobs/#{@solution[:job_sid]}"
end

Instance Method Details

#deleteBoolean

Delete the JobInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


89
90
91
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 89

def delete
   @version.delete('DELETE', @uri)
end

#fetchJobInstance

Fetch the JobInstance

Returns:


80
81
82
83
84
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 80

def fetch
  payload = @version.fetch('GET', @uri)

  JobInstance.new(@version, payload, job_sid: @solution[:job_sid], )
end

#inspectObject

Provide a detailed, user friendly representation


102
103
104
105
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 102

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Bulkexports.V1.JobContext #{context}>"
end

#to_sObject

Provide a user friendly representation


95
96
97
98
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 95

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Bulkexports.V1.JobContext #{context}>"
end