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



135
136
137
138
139
140
141
142
143
144
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 135

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



172
173
174
175
176
177
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 172

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

#deleteBoolean

Delete the ContentInstance



148
149
150
151
152
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 148

def delete

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

#fetchContentInstance

Fetch the ContentInstance



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

def fetch

    
    payload = @version.fetch('GET', @uri)
    ContentInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



188
189
190
191
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 188

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

#to_sObject

Provide a user friendly representation



181
182
183
184
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 181

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