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



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 517

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



551
552
553
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 551

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



542
543
544
545
546
547
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 542

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

#date_createdTime



587
588
589
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 587

def date_created
    @properties['date_created']
end

#date_updatedTime



593
594
595
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 593

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ChannelInstance



600
601
602
603
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 600

def delete

    context.delete
end

#fetchChannelInstance

Fetch the ChannelInstance



608
609
610
611
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 608

def fetch

    context.fetch
end

#flex_flow_sidString



557
558
559
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 557

def flex_flow_sid
    @properties['flex_flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



622
623
624
625
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 622

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

#sidString



563
564
565
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 563

def sid
    @properties['sid']
end

#task_sidString



575
576
577
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 575

def task_sid
    @properties['task_sid']
end

#to_sObject

Provide a user friendly representation



615
616
617
618
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 615

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

#urlString



581
582
583
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 581

def url
    @properties['url']
end

#user_sidString



569
570
571
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 569

def user_sid
    @properties['user_sid']
end