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/media_recording.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, MediaRecordingContext, MediaRecordingInstance, MediaRecordingList, MediaRecordingPage, 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
21
# File 'lib/twilio-ruby/rest/media/v1.rb', line 15

def initialize(domain)
  super
  @version = 'v1'
  @media_processor = nil
  @media_recording = 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:


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

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

#media_recording(sid = :unset) ⇒ Twilio::REST::Media::V1::MediaRecordingContext, Twilio::REST::Media::V1::MediaRecordingList

Parameters:

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

    The SID of the MediaRecording resource to fetch.

Returns:


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

def media_recording(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @media_recording ||= MediaRecordingList.new self
  else
      MediaRecordingContext.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:


57
58
59
60
61
62
63
64
65
66
# File 'lib/twilio-ruby/rest/media/v1.rb', line 57

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


70
71
72
# File 'lib/twilio-ruby/rest/media/v1.rb', line 70

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