class Twilio::REST::FlexApi::V1::ChannelInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the ChannelInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The SID of the Flex chat channel resource to fetch. @return [ChannelInstance] ChannelInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
230 def initialize(version, payload, sid: nil)
231   super(version)
232 
233   # Marshaled Properties
234   @properties = {
235       'account_sid' => payload['account_sid'],
236       'flex_flow_sid' => payload['flex_flow_sid'],
237       'sid' => payload['sid'],
238       'user_sid' => payload['user_sid'],
239       'task_sid' => payload['task_sid'],
240       'url' => payload['url'],
241       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
242       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
243   }
244 
245   # Context
246   @instance_context = nil
247   @params = {'sid' => sid || @properties['sid'], }
248 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource and owns this Workflow

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
263 def account_sid
264   @properties['account_sid']
265 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ChannelContext] ChannelContext for this ChannelInstance

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
254 def context
255   unless @instance_context
256     @instance_context = ChannelContext.new(@version, @params['sid'], )
257   end
258   @instance_context
259 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the Flex chat channel was created

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
299 def date_created
300   @properties['date_created']
301 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the Flex chat channel was last updated

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
305 def date_updated
306   @properties['date_updated']
307 end
delete() click to toggle source

Delete the ChannelInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
319 def delete
320   context.delete
321 end
fetch() click to toggle source

Fetch the ChannelInstance @return [ChannelInstance] Fetched ChannelInstance

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
312 def fetch
313   context.fetch
314 end
flex_flow_sid() click to toggle source

@return [String] The SID of the Flex Flow

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
269 def flex_flow_sid
270   @properties['flex_flow_sid']
271 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
332 def inspect
333   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
334   "<Twilio.FlexApi.V1.ChannelInstance #{values}>"
335 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
275 def sid
276   @properties['sid']
277 end
task_sid() click to toggle source

@return [String] The SID of the TaskRouter Task

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
287 def task_sid
288   @properties['task_sid']
289 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
325 def to_s
326   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
327   "<Twilio.FlexApi.V1.ChannelInstance #{values}>"
328 end
url() click to toggle source

@return [String] The absolute URL of the Flex chat channel resource

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
293 def url
294   @properties['url']
295 end
user_sid() click to toggle source

@return [String] The SID of the chat user

    # File lib/twilio-ruby/rest/flex_api/v1/channel.rb
281 def user_sid
282   @properties['user_sid']
283 end