lib/twilio-ruby/rest/studio/v1/flow/engagement.rb in twilio-ruby-5.6.4 vs lib/twilio-ruby/rest/studio/v1/flow/engagement.rb in twilio-ruby-5.7.0
- old
+ new
@@ -180,10 +180,11 @@
@solution = {flow_sid: flow_sid, sid: sid, }
@uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:sid]}"
# Dependents
@steps = nil
+ @engagement_context = nil
end
##
# Fetch a EngagementInstance
# @return [EngagementInstance] Fetched EngagementInstance
@@ -216,10 +217,18 @@
@steps
end
##
+ # Access the engagement_context
+ # @return [EngagementContextList]
+ # @return [EngagementContextContext]
+ def engagement_context
+ EngagementContextContext.new(@version, @solution[:flow_sid], @solution[:sid], )
+ end
+
+ ##
# Provide a user friendly representation
def to_s
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
"#<Twilio.Studio.V1.EngagementContext #{context}>"
end
@@ -244,11 +253,10 @@
'account_sid' => payload['account_sid'],
'flow_sid' => payload['flow_sid'],
'contact_sid' => payload['contact_sid'],
'contact_channel_address' => payload['contact_channel_address'],
'status' => payload['status'],
- 'context' => payload['context'],
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
'url' => payload['url'],
'links' => payload['links'],
}
@@ -304,16 +312,10 @@
def status
@properties['status']
end
##
- # @return [Hash] The context
- def context
- @properties['context']
- end
-
- ##
# @return [Time] The date_created
def date_created
@properties['date_created']
end
@@ -345,9 +347,16 @@
##
# Access the steps
# @return [steps] steps
def steps
context.steps
+ end
+
+ ##
+ # Access the engagement_context
+ # @return [engagement_context] engagement_context
+ def engagement_context
+ context.engagement_context
end
##
# Provide a user friendly representation
def to_s
\ No newline at end of file