Class: Twilio::REST::Serverless::V1::ServiceContext::EnvironmentInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Serverless::V1::ServiceContext::EnvironmentInstance
- Defined in:
- lib/twilio-ruby/rest/serverless/v1/service/environment.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.
-
#build_sid ⇒ String
Build Sid.
-
#context ⇒ EnvironmentContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Environment was created.
-
#date_updated ⇒ Time
The date that this Environment was updated.
-
#delete ⇒ Boolean
Deletes the EnvironmentInstance.
-
#deployments ⇒ deployments
Access the deployments.
-
#domain_name ⇒ String
The base domain name for all Functions and Assets deployed in this Environment.
-
#domain_suffix ⇒ String
A URL-friendly name that represents this Environment.
-
#fetch ⇒ EnvironmentInstance
Fetch a EnvironmentInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ EnvironmentInstance
constructor
Initialize the EnvironmentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
Nested resource URLs.
-
#logs ⇒ logs
Access the logs.
-
#service_sid ⇒ String
Service Sid.
-
#sid ⇒ String
Environment Sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
A unique, addressable name of this Environment.
-
#url ⇒ String
The URL of this Environment.
-
#variables ⇒ variables
Access the variables.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ EnvironmentInstance
Initialize the EnvironmentInstance
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 314 def initialize(version, payload, service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'build_sid' => payload['build_sid'], 'unique_name' => payload['unique_name'], 'domain_suffix' => payload['domain_suffix'], 'domain_name' => payload['domain_name'], '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 = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
356 357 358 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 356 def account_sid @properties['account_sid'] end |
#build_sid ⇒ String
Returns Build Sid.
368 369 370 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 368 def build_sid @properties['build_sid'] end |
#context ⇒ EnvironmentContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
341 342 343 344 345 346 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 341 def context unless @instance_context @instance_context = EnvironmentContext.new(@version, @params['service_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Environment was created.
392 393 394 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 392 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Environment was updated.
398 399 400 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 398 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the EnvironmentInstance
424 425 426 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 424 def delete context.delete end |
#deployments ⇒ deployments
Access the deployments
438 439 440 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 438 def deployments context.deployments end |
#domain_name ⇒ String
Returns The base domain name for all Functions and Assets deployed in this Environment.
386 387 388 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 386 def domain_name @properties['domain_name'] end |
#domain_suffix ⇒ String
Returns A URL-friendly name that represents this Environment.
380 381 382 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 380 def domain_suffix @properties['domain_suffix'] end |
#fetch ⇒ EnvironmentInstance
Fetch a EnvironmentInstance
417 418 419 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 417 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
458 459 460 461 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 458 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.EnvironmentInstance #{values}>" end |
#links ⇒ String
Returns Nested resource URLs.
410 411 412 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 410 def links @properties['links'] end |
#logs ⇒ logs
Access the logs
445 446 447 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 445 def logs context.logs end |
#service_sid ⇒ String
Returns Service Sid.
362 363 364 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 362 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns Environment Sid.
350 351 352 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 350 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
451 452 453 454 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 451 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.EnvironmentInstance #{values}>" end |
#unique_name ⇒ String
Returns A unique, addressable name of this Environment.
374 375 376 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 374 def unique_name @properties['unique_name'] end |
#url ⇒ String
Returns The URL of this Environment.
404 405 406 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 404 def url @properties['url'] end |
#variables ⇒ variables
Access the variables
431 432 433 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 431 def variables context.variables end |