class Twilio::REST::Studio::V1::FlowContext::EngagementContext
Public Class Methods
new(version, flow_sid, sid)
click to toggle source
Initialize the EngagementContext
@param [Version] version Version
that contains the resource @param [String] flow_sid The SID of the Flow. @param [String] sid The SID of the Engagement resource to fetch. @return [EngagementContext] EngagementContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 178 def initialize(version, flow_sid, sid) 179 super(version) 180 181 # Path Solution 182 @solution = {flow_sid: flow_sid, sid: sid, } 183 @uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:sid]}" 184 185 # Dependents 186 @steps = nil 187 @engagement_context = nil 188 end
Public Instance Methods
delete()
click to toggle source
Delete the EngagementInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 202 def delete 203 @version.delete('DELETE', @uri) 204 end
engagement_context()
click to toggle source
Access the engagement_context
@return [EngagementContextList] @return [EngagementContextContext]
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 228 def engagement_context 229 EngagementContextContext.new(@version, @solution[:flow_sid], @solution[:sid], ) 230 end
fetch()
click to toggle source
Fetch the EngagementInstance
@return [EngagementInstance] Fetched EngagementInstance
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 193 def fetch 194 payload = @version.fetch('GET', @uri) 195 196 EngagementInstance.new(@version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid], ) 197 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 241 def inspect 242 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 243 "#<Twilio.Studio.V1.EngagementContext #{context}>" 244 end
steps(sid=:unset)
click to toggle source
Access the steps @return [StepList] @return [StepContext] if sid was passed.
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 210 def steps(sid=:unset) 211 raise ArgumentError, 'sid cannot be nil' if sid.nil? 212 213 if sid != :unset 214 return StepContext.new(@version, @solution[:flow_sid], @solution[:sid], sid, ) 215 end 216 217 unless @steps 218 @steps = StepList.new(@version, flow_sid: @solution[:flow_sid], engagement_sid: @solution[:sid], ) 219 end 220 221 @steps 222 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/studio/v1/flow/engagement.rb 234 def to_s 235 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 236 "#<Twilio.Studio.V1.EngagementContext #{context}>" 237 end