Class: Twilio::REST::FlexApi::V1::InteractionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::FlexApi::V1::InteractionInstance
- Defined in:
- lib/twilio-ruby/rest/flex_api/v1/interaction.rb
Instance Method Summary collapse
-
#channel ⇒ Hash
A JSON object that defines the Interaction’s communication channel and includes details about the channel.
-
#channels ⇒ channels
Access the channels.
-
#context ⇒ InteractionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ InteractionInstance
Fetch the InteractionInstance.
-
#initialize(version, payload, sid: nil) ⇒ InteractionInstance
constructor
Initialize the InteractionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #interaction_context_sid ⇒ String
- #links ⇒ Hash
-
#routing ⇒ Hash
A JSON Object representing the routing rules for the Interaction Channel.
-
#sid ⇒ String
The unique string created by Twilio to identify an Interaction resource, prefixed with KD.
-
#to_s ⇒ Object
Provide a user friendly representation.
- #url ⇒ String
Constructor Details
#initialize(version, payload, sid: nil) ⇒ InteractionInstance
Initialize the InteractionInstance
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 182 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'channel' => payload['channel'], 'routing' => payload['routing'], 'url' => payload['url'], 'links' => payload['links'], 'interaction_context_sid' => payload['interaction_context_sid'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#channel ⇒ Hash
Returns A JSON object that defines the Interaction’s communication channel and includes details about the channel. See the [Outbound SMS](www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#agent-initiated-outbound-interactions) and [inbound (API-initiated)](www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#api-initiated-contact) Channel object examples.
219 220 221 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 219 def channel @properties['channel'] end |
#channels ⇒ channels
Access the channels
258 259 260 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 258 def channels context.channels end |
#context ⇒ InteractionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
204 205 206 207 208 209 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 204 def context unless @instance_context @instance_context = InteractionContext.new(@version , @params['sid']) end @instance_context end |
#fetch ⇒ InteractionInstance
Fetch the InteractionInstance
250 251 252 253 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 250 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
271 272 273 274 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 271 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.InteractionInstance #{values}>" end |
#interaction_context_sid ⇒ String
243 244 245 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 243 def interaction_context_sid @properties['interaction_context_sid'] end |
#links ⇒ Hash
237 238 239 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 237 def links @properties['links'] end |
#routing ⇒ Hash
Returns A JSON Object representing the routing rules for the Interaction Channel. See [Outbound SMS Example](www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#agent-initiated-outbound-interactions) for an example Routing object. The Interactions resource uses TaskRouter for all routing functionality. All attributes in the Routing object on your Interaction request body are added “as is” to the task. For a list of known attributes consumed by the Flex UI and/or Flex Insights, see [Known Task Attributes](www.twilio.com/docs/flex/developer/conversations/interactions-api#task-attributes).
225 226 227 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 225 def routing @properties['routing'] end |
#sid ⇒ String
Returns The unique string created by Twilio to identify an Interaction resource, prefixed with KD.
213 214 215 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 213 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
264 265 266 267 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 264 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.InteractionInstance #{values}>" end |
#url ⇒ String
231 232 233 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 231 def url @properties['url'] end |