Class: Twilio::REST::Media::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/media/v1.rb,
lib/twilio-ruby/rest/media/v1/media_processor.rb,
lib/twilio-ruby/rest/media/v1/player_streamer.rb,
lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb

Defined Under Namespace

Classes: MediaProcessorContext, MediaProcessorInstance, MediaProcessorList, MediaProcessorPage, PlayerStreamerContext, PlayerStreamerInstance, PlayerStreamerList, PlayerStreamerPage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Media



15
16
17
18
19
20
# File 'lib/twilio-ruby/rest/media/v1.rb', line 15

def initialize(domain)
  super
  @version = 'v1'
  @media_processor = nil
  @player_streamer = nil
end

Instance Method Details

#media_processor(sid = :unset) ⇒ Twilio::REST::Media::V1::MediaProcessorContext, Twilio::REST::Media::V1::MediaProcessorList

Parameters:

  • sid (String) (defaults to: :unset)

    The SID of the MediaProcessor resource to fetch.

Returns:



26
27
28
29
30
31
32
33
34
35
# File 'lib/twilio-ruby/rest/media/v1.rb', line 26

def media_processor(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @media_processor ||= MediaProcessorList.new self
  else
      MediaProcessorContext.new(self, sid)
  end
end

#player_streamer(sid = :unset) ⇒ Twilio::REST::Media::V1::PlayerStreamerContext, Twilio::REST::Media::V1::PlayerStreamerList

Parameters:

  • sid (String) (defaults to: :unset)

    The SID of the PlayerStreamer resource to fetch.

Returns:



41
42
43
44
45
46
47
48
49
50
# File 'lib/twilio-ruby/rest/media/v1.rb', line 41

def player_streamer(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @player_streamer ||= PlayerStreamerList.new self
  else
      PlayerStreamerContext.new(self, sid)
  end
end

#to_sObject

Provide a user friendly representation



54
55
56
# File 'lib/twilio-ruby/rest/media/v1.rb', line 54

def to_s
  '<Twilio::REST::Media::V1>'
end