Class: Twilio::REST::FlexApi::V1::ChannelInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/channel.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ChannelInstance

Initialize the ChannelInstance



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 266

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_sidString



299
300
301
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 299

def 
    @properties['account_sid']
end

#contextChannelContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



290
291
292
293
294
295
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 290

def context
    unless @instance_context
        @instance_context = ChannelContext.new(@version , @params['sid'])
    end
    @instance_context
end

#date_createdTime



335
336
337
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 335

def date_created
    @properties['date_created']
end

#date_updatedTime



341
342
343
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 341

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ChannelInstance



348
349
350
351
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 348

def delete

    context.delete
end

#fetchChannelInstance

Fetch the ChannelInstance



356
357
358
359
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 356

def fetch

    context.fetch
end

#flex_flow_sidString



305
306
307
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 305

def flex_flow_sid
    @properties['flex_flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



370
371
372
373
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 370

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.FlexApi.V1.ChannelInstance #{values}>"
end

#sidString



311
312
313
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 311

def sid
    @properties['sid']
end

#task_sidString



323
324
325
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 323

def task_sid
    @properties['task_sid']
end

#to_sObject

Provide a user friendly representation



363
364
365
366
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 363

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.FlexApi.V1.ChannelInstance #{values}>"
end

#urlString



329
330
331
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 329

def url
    @properties['url']
end

#user_sidString



317
318
319
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 317

def user_sid
    @properties['user_sid']
end