Class: Twilio::REST::Studio::V1::FlowContext::EngagementContext::EngagementContextInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Studio::V1::FlowContext::EngagementContext::EngagementContextInstance
- Defined in:
- lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account.
-
#context ⇒ Hash
As your flow executes, we save the state in what’s called the Flow Context.
-
#engagement_sid ⇒ String
The SID of the Engagement.
-
#fetch ⇒ EngagementContextInstance
Fetch the EngagementContextInstance.
-
#flow_sid ⇒ String
The SID of the Flow.
-
#initialize(version, payload, flow_sid: nil, engagement_sid: nil) ⇒ EngagementContextInstance
constructor
Initialize the EngagementContextInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of the resource.
Constructor Details
#initialize(version, payload, flow_sid: nil, engagement_sid: nil) ⇒ EngagementContextInstance
Initialize the EngagementContextInstance
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 129 def initialize(version, payload , flow_sid: nil, engagement_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'context' => payload['context'], 'engagement_sid' => payload['engagement_sid'], 'flow_sid' => payload['flow_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'flow_sid' => flow_sid || @properties['flow_sid'] ,'engagement_sid' => engagement_sid || @properties['engagement_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account.
159 160 161 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 159 def account_sid @properties['account_sid'] end |
#context ⇒ Hash
Returns As your flow executes, we save the state in what’s called the Flow Context. Any data in the flow context can be accessed by your widgets as variables, either in configuration fields or in text areas as variable substitution.
150 151 152 153 154 155 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 150 def context unless @instance_context @instance_context = EngagementContextContext.new(@version , @params['flow_sid'], @params['engagement_sid']) end @instance_context end |
#engagement_sid ⇒ String
Returns The SID of the Engagement.
171 172 173 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 171 def engagement_sid @properties['engagement_sid'] end |
#fetch ⇒ EngagementContextInstance
Fetch the EngagementContextInstance
190 191 192 193 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 190 def fetch context.fetch end |
#flow_sid ⇒ String
Returns The SID of the Flow.
177 178 179 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 177 def flow_sid @properties['flow_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
204 205 206 207 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 204 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Studio.V1.EngagementContextInstance #{values}>" end |
#to_s ⇒ Object
Provide a user friendly representation
197 198 199 200 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 197 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Studio.V1.EngagementContextInstance #{values}>" end |
#url ⇒ String
Returns The URL of the resource.
183 184 185 |
# File 'lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb', line 183 def url @properties['url'] end |