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
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/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 date and time in GMT when the Environment 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 Environment resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the EnvironmentInstance.
-
#deployments ⇒ deployments
Access the deployments.
-
#domain_name ⇒ String
The domain name for all Functions and Assets deployed in the Environment, using the Service unique name, a randomly-generated Service suffix, and an optional Environment domain suffix.
-
#domain_suffix ⇒ String
A URL-friendly name that represents the environment and forms part of the domain name.
-
#fetch ⇒ EnvironmentInstance
Fetch the EnvironmentInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ EnvironmentInstance
constructor
Initialize the EnvironmentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of the Environment resource’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 we created to identify the Environment resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
A user-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
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 309 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 || @properties['service_sid'] ,'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 Environment resource.
351 352 353 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 351 def account_sid @properties['account_sid'] end |
#build_sid ⇒ String
Returns The SID of the build deployed in the environment.
363 364 365 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 363 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
336 337 338 339 340 341 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 336 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 and time in GMT when the Environment resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
387 388 389 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 387 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the Environment resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
393 394 395 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 393 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the EnvironmentInstance
412 413 414 415 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 412 def delete context.delete end |
#deployments ⇒ deployments
Access the deployments
442 443 444 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 442 def deployments context.deployments end |
#domain_name ⇒ String
Returns The domain name for all Functions and Assets deployed in the Environment, using the Service unique name, a randomly-generated Service suffix, and an optional Environment domain suffix.
381 382 383 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 381 def domain_name @properties['domain_name'] end |
#domain_suffix ⇒ String
Returns A URL-friendly name that represents the environment and forms part of the domain name.
375 376 377 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 375 def domain_suffix @properties['domain_suffix'] end |
#fetch ⇒ EnvironmentInstance
Fetch the EnvironmentInstance
420 421 422 423 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 420 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
455 456 457 458 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 455 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.EnvironmentInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of the Environment resource’s nested resources.
405 406 407 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 405 def links @properties['links'] end |
#logs ⇒ logs
Access the logs
428 429 430 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 428 def logs context.logs end |
#service_sid ⇒ String
Returns The SID of the Service that the Environment resource is associated with.
357 358 359 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 357 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Environment resource.
345 346 347 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 345 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
448 449 450 451 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 448 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.EnvironmentInstance #{values}>" end |
#unique_name ⇒ String
Returns A user-defined string that uniquely identifies the Environment resource.
369 370 371 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 369 def unique_name @properties['unique_name'] end |
#url ⇒ String
Returns The absolute URL of the Environment resource.
399 400 401 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 399 def url @properties['url'] end |
#variables ⇒ variables
Access the variables
435 436 437 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 435 def variables context.variables end |