Class: Twilio::REST::FlexApi::V1::WebChannelInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the WebChannelInstance



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 278

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'],
        '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



309
310
311
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 309

def 
    @properties['account_sid']
end

#contextWebChannelContext

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



300
301
302
303
304
305
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 300

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

#date_createdTime



333
334
335
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 333

def date_created
    @properties['date_created']
end

#date_updatedTime



339
340
341
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 339

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the WebChannelInstance



346
347
348
349
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 346

def delete

    context.delete
end

#fetchWebChannelInstance

Fetch the WebChannelInstance



354
355
356
357
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 354

def fetch

    context.fetch
end

#flex_flow_sidString



315
316
317
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 315

def flex_flow_sid
    @properties['flex_flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



384
385
386
387
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 384

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

#sidString



321
322
323
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 321

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



377
378
379
380
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 377

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

#update(chat_status: :unset, post_engagement_data: :unset) ⇒ WebChannelInstance

Update the WebChannelInstance



364
365
366
367
368
369
370
371
372
373
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 364

def update(
    chat_status: :unset, 
    post_engagement_data: :unset
)

    context.update(
        chat_status: chat_status, 
        post_engagement_data: post_engagement_data, 
    )
end

#urlString



327
328
329
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 327

def url
    @properties['url']
end