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



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 339

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



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

def 
  @properties['account_sid']
end

#assetsassets

Access the assets



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

def assets
  context.assets
end

#buildsbuilds

Access the builds



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

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



364
365
366
367
368
369
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 364

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

#date_createdTime



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

def date_created
  @properties['date_created']
end

#date_updatedTime



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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the ServiceInstance



435
436
437
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 435

def delete
  context.delete
end

#environmentsenvironments

Access the environments



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

def environments
  context.environments
end

#fetchServiceInstance

Fetch a ServiceInstance



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

def fetch
  context.fetch
end

#friendly_nameString



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

def friendly_name
  @properties['friendly_name']
end

#functionsfunctions

Access the functions



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

def functions
  context.functions
end

#include_credentialsBoolean



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

def include_credentials
  @properties['include_credentials']
end

#inspectObject

Provide a detailed, user friendly representation



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

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


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

def links
  @properties['links']
end

#sidString



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

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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

#unique_nameString



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

def unique_name
  @properties['unique_name']
end

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

Update the ServiceInstance



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

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

#urlString



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

def url
  @properties['url']
end