Class: Twilio::REST::Microvisor::V1::AppInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ AppInstance

Initialize the AppInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this App resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 229

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'hash' => payload['hash'],
        'unique_name' => payload['unique_name'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



268
269
270
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 268

def 
    @properties['account_sid']
end

#app_manifestsapp_manifests

Access the app_manifests

Returns:



327
328
329
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 327

def app_manifests
    context.app_manifests
end

#contextAppContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:

  • (AppContext)

    CallContext for this CallInstance



253
254
255
256
257
258
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 253

def context
    unless @instance_context
        @instance_context = AppContext.new(@version , @params['sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date that this App was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



286
287
288
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 286

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this App was last updated, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



292
293
294
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 292

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the AppInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



311
312
313
314
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 311

def delete

    context.delete
end

#fetchAppInstance

Fetch the AppInstance

Returns:



319
320
321
322
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 319

def fetch

    context.fetch
end

#hashString

Returns App manifest hash represented as ‘hash_algorithm:hash_value`.

Returns:

  • (String)

    App manifest hash represented as ‘hash_algorithm:hash_value`.



274
275
276
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 274

def hash
    @properties['hash']
end

#inspectObject

Provide a detailed, user friendly representation



340
341
342
343
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 340

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Microvisor.V1.AppInstance #{values}>"
end

Returns:

  • (Hash)


304
305
306
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 304

def links
    @properties['links']
end

#sidString

Returns A 34-character string that uniquely identifies this App.

Returns:

  • (String)

    A 34-character string that uniquely identifies this App.



262
263
264
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 262

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



333
334
335
336
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 333

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Microvisor.V1.AppInstance #{values}>"
end

#unique_nameString

Returns A developer-defined string that uniquely identifies the App. This value must be unique for all Apps on this Account. The ‘unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource.

Returns:

  • (String)

    A developer-defined string that uniquely identifies the App. This value must be unique for all Apps on this Account. The ‘unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource.



280
281
282
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 280

def unique_name
    @properties['unique_name']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



298
299
300
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 298

def url
    @properties['url']
end