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

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/microvisor/v1/app.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].

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

  • sid (String) (defaults to: nil)

    A 34-character string that uniquely identifies this App.



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 202

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'],
  }

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

Instance Method Details

#account_sidString

Returns The Account SID.

Returns:

  • (String)

    The Account SID.



240
241
242
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 240

def 
  @properties['account_sid']
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)

    AppContext for this AppInstance



225
226
227
228
229
230
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 225

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.

Returns:

  • (Time)

    The date that this App was created.



258
259
260
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 258

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date that this App was last updated.

Returns:

  • (Time)

    The date that this App was last updated.



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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the AppInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



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

def delete
  context.delete
end

#fetchAppInstance

Fetch the AppInstance

Returns:



277
278
279
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 277

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.



246
247
248
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 246

def hash
  @properties['hash']
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#sidString

Returns A string that uniquely identifies this App.

Returns:

  • (String)

    A string that uniquely identifies this App.



234
235
236
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 234

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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

#unique_nameString

Returns An developer-defined string that uniquely identifies the App.

Returns:

  • (String)

    An developer-defined string that uniquely identifies the App.



252
253
254
# File 'lib/twilio-ruby/rest/microvisor/v1/app.rb', line 252

def unique_name
  @properties['unique_name']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



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

def url
  @properties['url']
end