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
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/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 date and time in GMT when the Service resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the Service resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#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 ⇒ Hash
The URLs of the Service’s nested resources.
-
#sid ⇒ String
The unique string that we created to identify 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
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 376 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](www.twilio.com/docs/iam/api/account) that created the Service resource.
418 419 420 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 418 def account_sid @properties['account_sid'] end |
#assets ⇒ assets
Access the assets
535 536 537 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 535 def assets context.assets end |
#builds ⇒ builds
Access the builds
528 529 530 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 528 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
403 404 405 406 407 408 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 403 def context unless @instance_context @instance_context = ServiceContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the Service resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
454 455 456 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 454 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the Service resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
460 461 462 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 460 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
479 480 481 482 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 479 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.
448 449 450 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 448 def domain_base @properties['domain_base'] end |
#environments ⇒ environments
Access the environments
514 515 516 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 514 def environments context.environments end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
487 488 489 490 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 487 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Service resource.
424 425 426 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 424 def friendly_name @properties['friendly_name'] end |
#functions ⇒ functions
Access the functions
521 522 523 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 521 def functions context.functions end |
#include_credentials ⇒ Boolean
Returns Whether to inject Account credentials into a function invocation context.
436 437 438 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 436 def include_credentials @properties['include_credentials'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
548 549 550 551 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 548 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.ServiceInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of the Service’s nested resources.
472 473 474 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 472 def links @properties['links'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Service resource.
412 413 414 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 412 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
541 542 543 544 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 541 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.
442 443 444 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 442 def ui_editable @properties['ui_editable'] end |
#unique_name ⇒ String
Returns A user-defined string that uniquely identifies the Service resource. It can be used in place of the Service resource’s ‘sid` in the URL to address the Service resource.
430 431 432 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 430 def unique_name @properties['unique_name'] end |
#update(include_credentials: :unset, friendly_name: :unset, ui_editable: :unset) ⇒ ServiceInstance
Update the ServiceInstance
498 499 500 501 502 503 504 505 506 507 508 509 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 498 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.
466 467 468 |
# File 'lib/twilio-ruby/rest/serverless/v1/service.rb', line 466 def url @properties['url'] end |