Class: Twilio::REST::Serverless::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Serverless::V1::ServiceInstance
- 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
-
#account_sid ⇒ String
The account_sid.
-
#assets ⇒ assets
Access the assets.
-
#builds ⇒ builds
Access the builds.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#environments ⇒ environments
Access the environments.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#friendly_name ⇒ String
The friendly_name.
-
#functions ⇒ functions
Access the functions.
-
#include_credentials ⇒ Boolean
The include_credentials.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#sid ⇒ String
The sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
The unique_name.
-
#update(include_credentials: :unset, friendly_name: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 324 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_sid ⇒ String
Returns The account_sid.
364 365 366 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 364 def account_sid @properties['account_sid'] end |
#assets ⇒ assets
Access the assets
443 444 445 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 443 def assets context.assets end |
#builds ⇒ builds
Access the builds
450 451 452 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 450 def builds context.builds end |
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
349 350 351 352 353 354 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 349 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date_created.
388 389 390 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 388 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
394 395 396 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 394 def date_updated @properties['date_updated'] end |
#environments ⇒ environments
Access the environments
429 430 431 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 429 def environments context.environments end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
413 414 415 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 413 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The friendly_name.
370 371 372 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 370 def friendly_name @properties['friendly_name'] end |
#functions ⇒ functions
Access the functions
436 437 438 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 436 def functions context.functions end |
#include_credentials ⇒ Boolean
Returns The include_credentials.
382 383 384 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 382 def include_credentials @properties['include_credentials'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
463 464 465 466 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 463 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The links.
406 407 408 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 406 def links @properties['links'] end |
#sid ⇒ String
Returns The sid.
358 359 360 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 358 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
456 457 458 459 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 456 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.ServiceInstance #{values}>" end |
#unique_name ⇒ String
Returns The unique_name.
376 377 378 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 376 def unique_name @properties['unique_name'] end |
#update(include_credentials: :unset, friendly_name: :unset) ⇒ ServiceInstance
Update the ServiceInstance
422 423 424 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 422 def update(include_credentials: :unset, friendly_name: :unset) context.update(include_credentials: include_credentials, friendly_name: friendly_name, ) end |
#url ⇒ String
Returns The url.
400 401 402 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 400 def url @properties['url'] end |