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

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/content/v1.rb,
lib/twilio-ruby/rest/content/v1/content.rb,
lib/twilio-ruby/rest/content/v1/legacy_content.rb,
lib/twilio-ruby/rest/content/v1/content_and_approvals.rb,
lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb

Defined Under Namespace

Classes: ContentAndApprovalsInstance, ContentAndApprovalsList, ContentAndApprovalsPage, ContentContext, ContentInstance, ContentList, ContentPage, LegacyContentInstance, LegacyContentList, LegacyContentPage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Content



15
16
17
18
19
20
21
# File 'lib/twilio-ruby/rest/content/v1.rb', line 15

def initialize(domain)
  super
  @version = 'v1'
  @contents = nil
  @content_and_approvals = nil
  @legacy_contents = nil
end

Instance Method Details

#content_and_approvalsTwilio::REST::Content::V1::ContentAndApprovalsContext

Returns:

  • (Twilio::REST::Content::V1::ContentAndApprovalsContext)


41
42
43
# File 'lib/twilio-ruby/rest/content/v1.rb', line 41

def content_and_approvals
  @content_and_approvals ||= ContentAndApprovalsList.new self
end

#contents(sid = :unset) ⇒ Twilio::REST::Content::V1::ContentContext, Twilio::REST::Content::V1::ContentList

Parameters:

  • sid (String) (defaults to: :unset)

    The Twilio-provided string that uniquely identifies the Content resource to fetch.

Returns:



28
29
30
31
32
33
34
35
36
37
# File 'lib/twilio-ruby/rest/content/v1.rb', line 28

def contents(sid=:unset)
  if sid.nil?
      raise ArgumentError, 'sid cannot be nil'
  end
  if sid == :unset
      @contents ||= ContentList.new self
  else
      ContentContext.new(self, sid)
  end
end

#legacy_contentsTwilio::REST::Content::V1::LegacyContentContext

Returns:

  • (Twilio::REST::Content::V1::LegacyContentContext)


47
48
49
# File 'lib/twilio-ruby/rest/content/v1.rb', line 47

def legacy_contents
  @legacy_contents ||= LegacyContentList.new self
end

#to_sObject

Provide a user friendly representation



53
54
55
# File 'lib/twilio-ruby/rest/content/v1.rb', line 53

def to_s
  '<Twilio::REST::Content::V1>'
end