Class: Twilio::REST::FlexApi::V1::ChannelInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::FlexApi::V1::ChannelInstance
- Defined in:
- lib/twilio-ruby/rest/flex_api/v1/channel.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Channel resource and owns this Workflow.
-
#context ⇒ ChannelContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the Flex chat channel was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the Flex chat channel was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the ChannelInstance.
-
#fetch ⇒ ChannelInstance
Fetch the ChannelInstance.
-
#flex_flow_sid ⇒ String
The SID of the Flex Flow.
-
#initialize(version, payload, sid: nil) ⇒ ChannelInstance
constructor
Initialize the ChannelInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The unique string that we created to identify the Channel resource.
-
#task_sid ⇒ String
The SID of the TaskRouter Task.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Flex chat channel resource.
-
#user_sid ⇒ String
The SID of the chat user.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ChannelInstance
Initialize the ChannelInstance
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 263 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'flex_flow_sid' => payload['flex_flow_sid'], 'sid' => payload['sid'], 'user_sid' => payload['user_sid'], 'task_sid' => payload['task_sid'], 'url' => payload['url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Channel resource and owns this Workflow.
296 297 298 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 296 def account_sid @properties['account_sid'] end |
#context ⇒ ChannelContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
287 288 289 290 291 292 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 287 def context unless @instance_context @instance_context = ChannelContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the Flex chat channel was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
332 333 334 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 332 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the Flex chat channel was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
338 339 340 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 338 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ChannelInstance
345 346 347 348 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 345 def delete context.delete end |
#fetch ⇒ ChannelInstance
Fetch the ChannelInstance
353 354 355 356 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 353 def fetch context.fetch end |
#flex_flow_sid ⇒ String
Returns The SID of the Flex Flow.
302 303 304 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 302 def flex_flow_sid @properties['flex_flow_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
367 368 369 370 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 367 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.ChannelInstance #{values}>" end |
#sid ⇒ String
Returns The unique string that we created to identify the Channel resource.
308 309 310 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 308 def sid @properties['sid'] end |
#task_sid ⇒ String
Returns The SID of the TaskRouter Task. Only valid when integration type is ‘task`. `null` for integration types `studio` & `external`.
320 321 322 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 320 def task_sid @properties['task_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
360 361 362 363 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 360 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V1.ChannelInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the Flex chat channel resource.
326 327 328 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 326 def url @properties['url'] end |
#user_sid ⇒ String
Returns The SID of the chat user.
314 315 316 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 314 def user_sid @properties['user_sid'] end |