lib/twilio-ruby/rest/studio/v1/flow/engagement.rb in twilio-ruby-5.7.1 vs lib/twilio-ruby/rest/studio/v1/flow/engagement.rb in twilio-ruby-5.7.2
- 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
@@ -243,12 +252,12 @@
'sid' => payload['sid'],
'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'],
+ 'status' => payload['status'],
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
'url' => payload['url'],
'links' => payload['links'],
}
@@ -298,22 +307,22 @@
def contact_channel_address
@properties['contact_channel_address']
end
##
- # @return [engagement.Status] The status
- def status
- @properties['status']
- end
-
- ##
# @return [Hash] The context
def context
@properties['context']
end
##
+ # @return [engagement.Status] The status
+ def status
+ @properties['status']
+ end
+
+ ##
# @return [Time] The date_created
def date_created
@properties['date_created']
end
@@ -345,9 +354,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