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.



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 241

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.



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

def 
    @properties['account_sid']
end

#app_manifestsapp_manifests

Access the app_manifests

Returns:



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

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



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

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:



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

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:



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

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the AppInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



323
324
325
326
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 323

def delete

    context.delete
end

#fetchAppInstance

Fetch the AppInstance

Returns:



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

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`.



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

def hash
    @properties['hash']
end

#inspectObject

Provide a detailed, user friendly representation



352
353
354
355
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 352

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

Returns:

  • (Hash)


316
317
318
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 316

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.



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

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



345
346
347
348
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 345

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.



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

def unique_name
    @properties['unique_name']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



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

def url
    @properties['url']
end