class Twilio::REST::Trunking::V1::TrunkContext::RecordingInstance

Public Class Methods

new(version, payload, trunk_sid: nil) click to toggle source

Initialize the RecordingInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] trunk_sid The unique string that we created to identify the

Trunk resource.

@return [RecordingInstance] RecordingInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
127 def initialize(version, payload, trunk_sid: nil)
128   super(version)
129 
130   # Marshaled Properties
131   @properties = {'mode' => payload['mode'], 'trim' => payload['trim'], }
132 
133   # Context
134   @instance_context = nil
135   @params = {'trunk_sid' => trunk_sid, }
136 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [RecordingContext] RecordingContext for this RecordingInstance

    # File lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
142 def context
143   unless @instance_context
144     @instance_context = RecordingContext.new(@version, @params['trunk_sid'], )
145   end
146   @instance_context
147 end
fetch() click to toggle source

Fetch the RecordingInstance @return [RecordingInstance] Fetched RecordingInstance

    # File lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
164 def fetch
165   context.fetch
166 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
189 def inspect
190   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
191   "<Twilio.Trunking.V1.RecordingInstance #{values}>"
192 end
mode() click to toggle source

@return [recording.RecordingMode] The recording mode for the trunk.

    # File lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
151 def mode
152   @properties['mode']
153 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
182 def to_s
183   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
184   "<Twilio.Trunking.V1.RecordingInstance #{values}>"
185 end
trim() click to toggle source

@return [recording.RecordingTrim] The recording trim setting for the trunk.

    # File lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
157 def trim
158   @properties['trim']
159 end
update(mode: :unset, trim: :unset) click to toggle source

Update the RecordingInstance @param [recording.RecordingMode] mode The recording mode for the trunk. Can be

do-not-record (default), record-from-ringing, record-from-answer,
record-from-ringing-dual, or record-from-answer-dual.

@param [recording.RecordingTrim] trim The recording trim setting for the trunk.

Can be do-not-trim (default) or trim-silence.

@return [RecordingInstance] Updated RecordingInstance

    # File lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb
176 def update(mode: :unset, trim: :unset)
177   context.update(mode: mode, trim: trim, )
178 end