Class: Twilio::REST::Content::V1::ContentInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the ContentInstance



644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 644

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'friendly_name' => payload['friendly_name'],
        'language' => payload['language'],
        'variables' => payload['variables'],
        'types' => payload['types'],
        'url' => payload['url'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString



697
698
699
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 697

def 
    @properties['account_sid']
end

#approval_createapproval_create

Access the approval_create



756
757
758
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 756

def approval_create
    context.approval_create
end

#approval_fetchapproval_fetch

Access the approval_fetch



763
764
765
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 763

def approval_fetch
    context.approval_fetch
end

#contextContentContext

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



670
671
672
673
674
675
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 670

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

#date_createdTime



679
680
681
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 679

def date_created
    @properties['date_created']
end

#date_updatedTime



685
686
687
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 685

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ContentInstance



740
741
742
743
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 740

def delete

    context.delete
end

#fetchContentInstance

Fetch the ContentInstance



748
749
750
751
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 748

def fetch

    context.fetch
end

#friendly_nameString



703
704
705
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 703

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



776
777
778
779
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 776

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

#languageString



709
710
711
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 709

def language
    @properties['language']
end


733
734
735
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 733

def links
    @properties['links']
end

#sidString



691
692
693
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 691

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



769
770
771
772
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 769

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

#typesHash



721
722
723
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 721

def types
    @properties['types']
end

#urlString



727
728
729
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 727

def url
    @properties['url']
end

#variablesHash



715
716
717
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 715

def variables
    @properties['variables']
end