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 beta products that are subject to change. Use them with caution.
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
Delete the ServiceInstance.
-
#domain_base ⇒ String
The base domain name for this Service, which is a combination of the unique name and a randomly generated string.
-
#environments ⇒ environments
Access the environments.
-
#fetch ⇒ ServiceInstance
Fetch the 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 resource's properties and subresources can be edited via the UI.
-
#unique_name ⇒ String
A user-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
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# 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'], 'domain_base' => payload['domain_base'], '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.
369 370 371 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 369 def account_sid @properties['account_sid'] end |
#assets ⇒ assets
Access the assets
475 476 477 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 475 def assets context.assets end |
#builds ⇒ builds
Access the builds
482 483 484 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 482 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
354 355 356 357 358 359 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 354 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.
405 406 407 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 405 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.
411 412 413 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 411 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
437 438 439 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 437 def delete context.delete end |
#domain_base ⇒ String
Returns The base domain name for this Service, which is a combination of the unique name and a randomly generated string.
399 400 401 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 399 def domain_base @properties['domain_base'] end |
#environments ⇒ environments
Access the environments
461 462 463 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 461 def environments context.environments end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
430 431 432 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 430 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Service resource.
375 376 377 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 375 def friendly_name @properties['friendly_name'] end |
#functions ⇒ functions
Access the functions
468 469 470 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 468 def functions context.functions end |
#include_credentials ⇒ Boolean
Returns Whether to inject Account credentials into a function invocation context.
387 388 389 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 387 def include_credentials @properties['include_credentials'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
495 496 497 498 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 495 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.
423 424 425 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 423 def links @properties['links'] end |
#sid ⇒ String
Returns The unique string that identifies the Service resource.
363 364 365 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 363 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
488 489 490 491 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 488 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.ServiceInstance #{values}>" end |
#ui_editable ⇒ Boolean
Returns Whether the Service resource's properties and subresources can be edited via the UI.
393 394 395 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 393 def ui_editable @properties['ui_editable'] end |
#unique_name ⇒ String
Returns A user-defined string that uniquely identifies the Service resource.
381 382 383 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 381 def unique_name @properties['unique_name'] end |
#update(include_credentials: :unset, friendly_name: :unset, ui_editable: :unset) ⇒ ServiceInstance
Update the ServiceInstance
450 451 452 453 454 455 456 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 450 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.
417 418 419 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 417 def url @properties['url'] end |