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 unique SID identifier of the fax.

  • sid (String)

    A 34 character string that uniquely identifies this fax media.



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

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



206
207
208
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 206

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

#fetchFaxMediaInstance

Fetch a FaxMediaInstance

Returns:



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 186

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

#to_sObject

Provide a user friendly representation



212
213
214
215
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 212

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