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
The SID of the Account that created the Environment resource.
-
#build_sid ⇒ String
The SID of the build deployed in the environment.
-
#context ⇒ EnvironmentContext
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 Environment resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the Environment resource was last 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 the environment.
-
#domain_suffix ⇒ String
A URL-friendly name that represents the 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
The URLs of the environment’s nested resources.
-
#logs ⇒ logs
Access the logs.
-
#service_sid ⇒ String
The SID of the Service that the Environment resource is associated with.
-
#sid ⇒ String
The unique string that identifies the Environment resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
An application-defined string that uniquely identifies the Environment resource.
-
#url ⇒ String
The absolute URL of the Environment resource.
-
#variables ⇒ variables
Access the variables.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ EnvironmentInstance
Initialize the EnvironmentInstance
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 316 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 The SID of the Account that created the Environment resource.
358 359 360 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 358 def account_sid @properties['account_sid'] end |
#build_sid ⇒ String
Returns The SID of the build deployed in the environment.
370 371 372 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 370 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
343 344 345 346 347 348 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 343 def context unless @instance_context @instance_context = EnvironmentContext.new(@version, @params['service_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the Environment resource was created.
394 395 396 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 394 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the Environment resource was last updated.
400 401 402 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 400 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the EnvironmentInstance
426 427 428 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 426 def delete context.delete end |
#deployments ⇒ deployments
Access the deployments
440 441 442 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 440 def deployments context.deployments end |
#domain_name ⇒ String
Returns The base domain name for all Functions and Assets deployed in the environment.
388 389 390 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 388 def domain_name @properties['domain_name'] end |
#domain_suffix ⇒ String
Returns A URL-friendly name that represents the environment.
382 383 384 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 382 def domain_suffix @properties['domain_suffix'] end |
#fetch ⇒ EnvironmentInstance
Fetch a EnvironmentInstance
419 420 421 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 419 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
460 461 462 463 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 460 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.EnvironmentInstance #{values}>" end |
#links ⇒ String
Returns The URLs of the environment’s nested resources.
412 413 414 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 412 def links @properties['links'] end |
#logs ⇒ logs
Access the logs
447 448 449 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 447 def logs context.logs end |
#service_sid ⇒ String
Returns The SID of the Service that the Environment resource is associated with.
364 365 366 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 364 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that identifies the Environment resource.
352 353 354 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 352 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
453 454 455 456 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 453 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.EnvironmentInstance #{values}>" end |
#unique_name ⇒ String
Returns An application-defined string that uniquely identifies the Environment resource.
376 377 378 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 376 def unique_name @properties['unique_name'] end |
#url ⇒ String
Returns The absolute URL of the Environment resource.
406 407 408 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 406 def url @properties['url'] end |
#variables ⇒ variables
Access the variables
433 434 435 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 433 def variables context.variables end |