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



1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1768

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



1822
1823
1824
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1822

def 
    @properties['account_sid']
end

#approval_createapproval_create

Access the approval_create



1892
1893
1894
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1892

def approval_create
    context.approval_create
end

#approval_fetchapproval_fetch

Access the approval_fetch



1899
1900
1901
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1899

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



1795
1796
1797
1798
1799
1800
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1795

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

#date_createdTime



1804
1805
1806
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1804

def date_created
    @properties['date_created']
end

#date_updatedTime



1810
1811
1812
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1810

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ContentInstance



1865
1866
1867
1868
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1865

def delete

    context.delete
end

#fetchContentInstance

Fetch the ContentInstance



1873
1874
1875
1876
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1873

def fetch

    context.fetch
end

#friendly_nameString



1828
1829
1830
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1828

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



1912
1913
1914
1915
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1912

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

#languageString



1834
1835
1836
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1834

def language
    @properties['language']
end


1858
1859
1860
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1858

def links
    @properties['links']
end

#sidString



1816
1817
1818
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1816

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



1905
1906
1907
1908
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1905

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

#typesHash



1846
1847
1848
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1846

def types
    @properties['types']
end

#update(content_update_request: nil) ⇒ ContentInstance

Update the ContentInstance



1882
1883
1884
1885
1886
1887
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1882

def update(content_update_request: nil
)

    context.update(
    )
end

#urlString



1852
1853
1854
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1852

def url
    @properties['url']
end

#variablesHash



1840
1841
1842
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 1840

def variables
    @properties['variables']
end