Class: Twilio::REST::Fax::V1::FaxContext::FaxMediaContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/fax/v1/fax/fax_media.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, fax_sid, sid) ⇒ FaxMediaContext

Initialize the FaxMediaContext

Parameters:

  • version (Version)

    Version that contains the resource

  • fax_sid (String)

    The SID of the fax with the FaxMedia resource to fetch.

  • sid (String)

    The Twilio-provided string that uniquely identifies the FaxMedia resource to fetch.



161
162
163
164
165
166
167
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 161

def initialize(version, fax_sid, sid)
  super(version)

  # Path Solution
  @solution = {fax_sid: fax_sid, sid: sid, }
  @uri = "/Faxes/#{@solution[:fax_sid]}/Media/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Deletes the FaxMediaInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



187
188
189
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 187

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

#fetchFaxMediaInstance

Fetch a FaxMediaInstance

Returns:



172
173
174
175
176
177
178
179
180
181
182
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 172

def fetch
  params = Twilio::Values.of({})

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

  FaxMediaInstance.new(@version, payload, fax_sid: @solution[:fax_sid], sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation



200
201
202
203
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 200

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

#to_sObject

Provide a user friendly representation



193
194
195
196
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 193

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