Class: Twilio::REST::Microvisor::V1::AppContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/microvisor/v1/app.rb,
lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb

Defined Under Namespace

Classes: AppManifestContext, AppManifestInstance, AppManifestList, AppManifestPage

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ AppContext

Initialize the AppContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    A 34-character string that uniquely identifies this App.



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

def initialize(version, sid)
    super(version)

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

    # Dependents
    @app_manifests = nil
end

Instance Method Details

#app_manifestsAppManifestList, AppManifestContext

Access the app_manifests



181
182
183
184
185
186
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 181

def app_manifests
    AppManifestContext.new(
            @version,
            @solution[:sid]
            )
end

#deleteBoolean

Delete the AppInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



149
150
151
152
153
154
155
156
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 149

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#fetchAppInstance

Fetch the AppInstance

Returns:



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 161

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    AppInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



197
198
199
200
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 197

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

#to_sObject

Provide a user friendly representation



190
191
192
193
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 190

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