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
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 that this Service was created.
-
#date_updated ⇒ Time
The date that this Service was updated.
-
#environments ⇒ environments
Access the environments.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#friendly_name ⇒ String
A human-readable description of this Service.
-
#functions ⇒ functions
Access the functions.
-
#include_credentials ⇒ Boolean
Whether to inject Account credentials into a Function invocation context.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
Nested resource URLs.
-
#sid ⇒ String
Service Sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
A unique, URL-friendly name of this Service.
-
#update(include_credentials: :unset, friendly_name: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The URL of this Service.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 332 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 Account Sid.
372 373 374 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 372 def account_sid @properties['account_sid'] end |
#assets ⇒ assets
Access the assets
453 454 455 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 453 def assets context.assets end |
#builds ⇒ builds
Access the builds
460 461 462 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 460 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
357 358 359 360 361 362 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 357 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Service was created.
396 397 398 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 396 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Service was updated.
402 403 404 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 402 def date_updated @properties['date_updated'] end |
#environments ⇒ environments
Access the environments
439 440 441 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 439 def environments context.environments end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
421 422 423 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 421 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human-readable description of this Service.
378 379 380 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 378 def friendly_name @properties['friendly_name'] end |
#functions ⇒ functions
Access the functions
446 447 448 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 446 def functions context.functions end |
#include_credentials ⇒ Boolean
Returns Whether to inject Account credentials into a Function invocation context.
390 391 392 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 390 def include_credentials @properties['include_credentials'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
473 474 475 476 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 473 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns Nested resource URLs.
414 415 416 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 414 def links @properties['links'] end |
#sid ⇒ String
Returns Service Sid.
366 367 368 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 366 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
466 467 468 469 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 466 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.ServiceInstance #{values}>" end |
#unique_name ⇒ String
Returns A unique, URL-friendly name of this Service.
384 385 386 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 384 def unique_name @properties['unique_name'] end |
#update(include_credentials: :unset, friendly_name: :unset) ⇒ ServiceInstance
Update the ServiceInstance
432 433 434 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 432 def update(include_credentials: :unset, friendly_name: :unset) context.update(include_credentials: include_credentials, friendly_name: friendly_name, ) end |
#url ⇒ String
Returns The URL of this Service.
408 409 410 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 408 def url @properties['url'] end |