class Twilio::REST::Fax::V1::FaxContext
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
new(version, sid)
click to toggle source
Initialize the FaxContext
@param [Version] version Version
that contains the resource @param [String] sid The Twilio-provided string that uniquely identifies the Fax
resource to fetch.
@return [FaxContext] FaxContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/fax/v1/fax.rb 253 def initialize(version, sid) 254 super(version) 255 256 # Path Solution 257 @solution = {sid: sid, } 258 @uri = "/Faxes/#{@solution[:sid]}" 259 260 # Dependents 261 @media = nil 262 end
Public Instance Methods
delete()
click to toggle source
Delete the FaxInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/fax/v1/fax.rb 291 def delete 292 @version.delete('DELETE', @uri) 293 end
fetch()
click to toggle source
Fetch the FaxInstance
@return [FaxInstance] Fetched FaxInstance
# File lib/twilio-ruby/rest/fax/v1/fax.rb 267 def fetch 268 payload = @version.fetch('GET', @uri) 269 270 FaxInstance.new(@version, payload, sid: @solution[:sid], ) 271 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/fax/v1/fax.rb 322 def inspect 323 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 324 "#<Twilio.Fax.V1.FaxContext #{context}>" 325 end
media(sid=:unset)
click to toggle source
Access the media @return [FaxMediaList] @return [FaxMediaContext] if sid was passed.
# File lib/twilio-ruby/rest/fax/v1/fax.rb 299 def media(sid=:unset) 300 raise ArgumentError, 'sid cannot be nil' if sid.nil? 301 302 if sid != :unset 303 return FaxMediaContext.new(@version, @solution[:sid], sid, ) 304 end 305 306 unless @media 307 @media = FaxMediaList.new(@version, fax_sid: @solution[:sid], ) 308 end 309 310 @media 311 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/fax/v1/fax.rb 315 def to_s 316 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 317 "#<Twilio.Fax.V1.FaxContext #{context}>" 318 end
update(status: :unset)
click to toggle source
Update the FaxInstance
@param [fax.UpdateStatus] status The new
{status}[https://www.twilio.com/docs/fax/api/fax-resource#fax-status-values] of the resource. Can be only `canceled`. This may fail if transmission has already started.
@return [FaxInstance] Updated FaxInstance
# File lib/twilio-ruby/rest/fax/v1/fax.rb 280 def update(status: :unset) 281 data = Twilio::Values.of({'Status' => status, }) 282 283 payload = @version.update('POST', @uri, data: data) 284 285 FaxInstance.new(@version, payload, sid: @solution[:sid], ) 286 end