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



52
53
54
55
56
57
58
59
60
61
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 52

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



65
66
67
68
69
70
71
72
73
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 65

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadataBoolean

Delete the JobInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 78

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      job_instance = JobInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      .new(@version, job_instance, response.headers, response.status_code)
end

#fetchJobInstance

Fetch the JobInstance

Returns:



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 97

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    JobInstance.new(
        @version,
        payload,
        job_sid: @solution[:job_sid],
    )
end

#fetch_with_metadataJobInstance

Fetch the JobInstanceMetadata

Returns:



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 116

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    job_instance = JobInstance.new(
        @version,
        response.body,
        job_sid: @solution[:job_sid],
    )
    .new(
        @version,
        job_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



148
149
150
151
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 148

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

#to_sObject

Provide a user friendly representation



141
142
143
144
# File 'lib/twilio-ruby/rest/bulkexports/v1/export/job.rb', line 141

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