class Twilio::REST::Fax::V1::FaxContext::FaxMediaInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the FaxMediaInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] fax_sid
The SID of the fax the FaxMedia resource is associated
with.
@param [String] sid The Twilio-provided string that uniquely identifies the
FaxMedia resource to fetch.
@return [FaxMediaInstance] FaxMediaInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 210 def initialize(version, payload, fax_sid: nil, sid: nil) 211 super(version) 212 213 # Marshaled Properties 214 @properties = { 215 'sid' => payload['sid'], 216 'account_sid' => payload['account_sid'], 217 'fax_sid' => payload['fax_sid'], 218 'content_type' => payload['content_type'], 219 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 220 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 221 'url' => payload['url'], 222 } 223 224 # Context 225 @instance_context = nil 226 @params = {'fax_sid' => fax_sid, 'sid' => sid || @properties['sid'], } 227 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 248 def account_sid 249 @properties['account_sid'] 250 end
@return [String] The content type of the stored fax media
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 260 def content_type 261 @properties['content_type'] 262 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [FaxMediaContext] FaxMediaContext
for this FaxMediaInstance
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 233 def context 234 unless @instance_context 235 @instance_context = FaxMediaContext.new(@version, @params['fax_sid'], @params['sid'], ) 236 end 237 @instance_context 238 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 266 def date_created 267 @properties['date_created'] 268 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 272 def date_updated 273 @properties['date_updated'] 274 end
Delete the FaxMediaInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 292 def delete 293 context.delete 294 end
@return [String] The SID of the fax the FaxMedia resource is associated with
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 254 def fax_sid 255 @properties['fax_sid'] 256 end
Fetch the FaxMediaInstance
@return [FaxMediaInstance] Fetched FaxMediaInstance
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 285 def fetch 286 context.fetch 287 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 305 def inspect 306 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 307 "<Twilio.Fax.V1.FaxMediaInstance #{values}>" 308 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 242 def sid 243 @properties['sid'] 244 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 298 def to_s 299 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 300 "<Twilio.Fax.V1.FaxMediaInstance #{values}>" 301 end
@return [String] The absolute URL of the FaxMedia resource
# File lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb 278 def url 279 @properties['url'] 280 end