Class: Twilio::REST::Fax::V1::FaxContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Fax::V1::FaxContext
- Defined in:
- lib/twilio-ruby/rest/fax/v1/fax.rb,
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.
Defined Under Namespace
Classes: FaxMediaContext, FaxMediaInstance, FaxMediaList, FaxMediaPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the FaxInstance.
-
#fetch ⇒ FaxInstance
Fetch a FaxInstance.
-
#initialize(version, sid) ⇒ FaxContext
constructor
Initialize the FaxContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#media(sid = :unset) ⇒ FaxMediaList, FaxMediaContext
Access the media.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: :unset) ⇒ FaxInstance
Update the FaxInstance.
Constructor Details
#initialize(version, sid) ⇒ FaxContext
Initialize the FaxContext
257 258 259 260 261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 257 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Faxes/#{@solution[:sid]}" # Dependents @media = nil end |
Instance Method Details
#delete ⇒ Boolean
Deletes the FaxInstance
303 304 305 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 303 def delete @version.delete('delete', @uri) end |
#fetch ⇒ FaxInstance
Fetch a FaxInstance
271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 271 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) FaxInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
334 335 336 337 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 334 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Fax.V1.FaxContext #{context}>" end |
#media(sid = :unset) ⇒ FaxMediaList, FaxMediaContext
Access the media
311 312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 311 def media(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return FaxMediaContext.new(@version, @solution[:sid], sid, ) end unless @media @media = FaxMediaList.new(@version, fax_sid: @solution[:sid], ) end @media end |
#to_s ⇒ Object
Provide a user friendly representation
327 328 329 330 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 327 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Fax.V1.FaxContext #{context}>" end |
#update(status: :unset) ⇒ FaxInstance
Update the FaxInstance
288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 288 def update(status: :unset) data = Twilio::Values.of({'Status' => status, }) payload = @version.update( 'POST', @uri, data: data, ) FaxInstance.new(@version, payload, sid: @solution[:sid], ) end |