Class: Twilio::REST::Serverless::V1::ServiceInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/serverless/v1/service.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) ⇒ ServiceInstance

Initialize the ServiceInstance



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 327

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'friendly_name' => payload['friendly_name'],
      'unique_name' => payload['unique_name'],
      'include_credentials' => payload['include_credentials'],
      'ui_editable' => payload['ui_editable'],
      '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



368
369
370
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 368

def 
  @properties['account_sid']
end

#assetsassets

Access the assets



468
469
470
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 468

def assets
  context.assets
end

#buildsbuilds

Access the builds



475
476
477
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 475

def builds
  context.builds
end

#contextServiceContext

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



353
354
355
356
357
358
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 353

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

#date_createdTime



398
399
400
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 398

def date_created
  @properties['date_created']
end

#date_updatedTime



404
405
406
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 404

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the ServiceInstance



430
431
432
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 430

def delete
  context.delete
end

#environmentsenvironments

Access the environments



454
455
456
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 454

def environments
  context.environments
end

#fetchServiceInstance

Fetch the ServiceInstance



423
424
425
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 423

def fetch
  context.fetch
end

#friendly_nameString



374
375
376
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 374

def friendly_name
  @properties['friendly_name']
end

#functionsfunctions

Access the functions



461
462
463
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 461

def functions
  context.functions
end

#include_credentialsBoolean



386
387
388
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 386

def include_credentials
  @properties['include_credentials']
end

#inspectObject

Provide a detailed, user friendly representation



488
489
490
491
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 488

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


416
417
418
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 416

def links
  @properties['links']
end

#sidString



362
363
364
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 362

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



481
482
483
484
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 481

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

#ui_editableBoolean



392
393
394
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 392

def ui_editable
  @properties['ui_editable']
end

#unique_nameString



380
381
382
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 380

def unique_name
  @properties['unique_name']
end

#update(include_credentials: :unset, friendly_name: :unset, ui_editable: :unset) ⇒ ServiceInstance

Update the ServiceInstance



443
444
445
446
447
448
449
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 443

def update(include_credentials: :unset, friendly_name: :unset, ui_editable: :unset)
  context.update(
      include_credentials: include_credentials,
      friendly_name: friendly_name,
      ui_editable: ui_editable,
  )
end

#urlString



410
411
412
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 410

def url
  @properties['url']
end