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

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Defined Under Namespace

Classes: ApprovalFetchContext, ApprovalFetchInstance, ApprovalFetchList, ApprovalFetchPage

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ ContentContext

Initialize the ContentContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

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



155
156
157
158
159
160
161
162
163
164
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 155

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/Content/#{@solution[:sid]}"

  # Dependents
  @approval_fetch = nil
end

Instance Method Details

#approval_fetchApprovalFetchList, ApprovalFetchContext

Access the approval_fetch



186
187
188
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 186

def approval_fetch
  ApprovalFetchContext.new(@version, @solution[:sid], )
end

#deleteBoolean

Delete the ContentInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



178
179
180
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 178

def delete
   @version.delete('DELETE', @uri)
end

#fetchContentInstance

Fetch the ContentInstance

Returns:



169
170
171
172
173
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 169

def fetch
  payload = @version.fetch('GET', @uri)

  ContentInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation



199
200
201
202
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 199

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Content.V1.ContentContext #{context}>"
end

#to_sObject

Provide a user friendly representation



192
193
194
195
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 192

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Content.V1.ContentContext #{context}>"
end