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 SID of the Account that created the Service resource.
-
#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 ISO 8601 date and time in GMT when the Service resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the Service resource was last updated.
-
#delete ⇒ Boolean
Deletes the ServiceInstance.
-
#environments ⇒ environments
Access the environments.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the Service resource.
-
#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
The URLs of the Service’s nested resources.
-
#sid ⇒ String
The unique string that identifies the Service resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#ui_editable ⇒ Boolean
Whether the Service’s properties and subresources can be edited via the UI.
-
#unique_name ⇒ String
An application-defined string that uniquely identifies the Service resource.
-
#update(include_credentials: :unset, friendly_name: :unset, ui_editable: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The absolute URL of the Service resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 344 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_sid ⇒ String
Returns The SID of the Account that created the Service resource.
385 386 387 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 385 def account_sid @properties['account_sid'] end |
#assets ⇒ assets
Access the assets
485 486 487 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 485 def assets context.assets end |
#builds ⇒ builds
Access the builds
492 493 494 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 492 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
370 371 372 373 374 375 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 370 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the Service resource was created.
415 416 417 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 415 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the Service resource was last updated.
421 422 423 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 421 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
447 448 449 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 447 def delete context.delete end |
#environments ⇒ environments
Access the environments
471 472 473 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 471 def environments context.environments end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
440 441 442 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 440 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Service resource.
391 392 393 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 391 def friendly_name @properties['friendly_name'] end |
#functions ⇒ functions
Access the functions
478 479 480 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 478 def functions context.functions end |
#include_credentials ⇒ Boolean
Returns Whether to inject Account credentials into a function invocation context.
403 404 405 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 403 def include_credentials @properties['include_credentials'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
505 506 507 508 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 505 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The URLs of the Service’s nested resources.
433 434 435 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 433 def links @properties['links'] end |
#sid ⇒ String
Returns The unique string that identifies the Service resource.
379 380 381 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 379 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
498 499 500 501 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 498 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.ServiceInstance #{values}>" end |
#ui_editable ⇒ Boolean
Returns Whether the Service’s properties and subresources can be edited via the UI.
409 410 411 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 409 def ui_editable @properties['ui_editable'] end |
#unique_name ⇒ String
Returns An application-defined string that uniquely identifies the Service resource.
397 398 399 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 397 def unique_name @properties['unique_name'] end |
#update(include_credentials: :unset, friendly_name: :unset, ui_editable: :unset) ⇒ ServiceInstance
Update the ServiceInstance
460 461 462 463 464 465 466 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 460 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 |
#url ⇒ String
Returns The absolute URL of the Service resource.
427 428 429 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 427 def url @properties['url'] end |