Class: Twilio::REST::Content::V1::ContentContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Content::V1::ContentContext
- Defined in:
- lib/twilio-ruby/rest/content/v1/content.rb,
lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb,
lib/twilio-ruby/rest/content/v1/content/approval_create.rb
Defined Under Namespace
Classes: ApprovalCreateInstance, ApprovalCreateList, ApprovalCreatePage, ApprovalFetchContext, ApprovalFetchInstance, ApprovalFetchList, ApprovalFetchPage
Instance Method Summary collapse
-
#approval_create ⇒ ApprovalCreateList, ApprovalCreateContext
Access the approval_create.
-
#approval_fetch ⇒ ApprovalFetchList, ApprovalFetchContext
Access the approval_fetch.
-
#delete ⇒ Boolean
Delete the ContentInstance.
-
#fetch ⇒ ContentInstance
Fetch the ContentInstance.
-
#initialize(version, sid) ⇒ ContentContext
constructor
Initialize the ContentContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ ContentContext
Initialize the ContentContext
707 708 709 710 711 712 713 714 715 716 717 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 707 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Content/#{@solution[:sid]}" # Dependents @approval_create = nil @approval_fetch = nil end |
Instance Method Details
#approval_create ⇒ ApprovalCreateList, ApprovalCreateContext
Access the approval_create
753 754 755 756 757 758 759 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 753 def approval_create unless @approval_create @approval_create = ApprovalCreateList.new( @version, content_sid: @solution[:sid], ) end @approval_create end |
#approval_fetch ⇒ ApprovalFetchList, ApprovalFetchContext
Access the approval_fetch
764 765 766 767 768 769 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 764 def approval_fetch ApprovalFetchContext.new( @version, @solution[:sid] ) end |
#delete ⇒ Boolean
Delete the ContentInstance
721 722 723 724 725 726 727 728 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 721 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ ContentInstance
Fetch the ContentInstance
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 733 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ContentInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
780 781 782 783 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 780 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Content.V1.ContentContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
773 774 775 776 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 773 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Content.V1.ContentContext #{context}>" end |