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 account_sid.
-
#build_sid ⇒ String
The build_sid.
-
#context ⇒ EnvironmentContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#deployments ⇒ deployments
Access the deployments.
-
#domain_name ⇒ String
The domain_name.
-
#domain_suffix ⇒ String
The domain_suffix.
-
#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 links.
-
#service_sid ⇒ String
The service_sid.
-
#sid ⇒ String
The sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
The unique_name.
-
#url ⇒ String
The url.
-
#variables ⇒ variables
Access the variables.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ EnvironmentInstance
Initialize the EnvironmentInstance
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 278 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 account_sid.
320 321 322 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 320 def account_sid @properties['account_sid'] end |
#build_sid ⇒ String
Returns The build_sid.
332 333 334 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 332 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
305 306 307 308 309 310 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 305 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_created.
356 357 358 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 356 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
362 363 364 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 362 def date_updated @properties['date_updated'] end |
#deployments ⇒ deployments
Access the deployments
395 396 397 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 395 def deployments context.deployments end |
#domain_name ⇒ String
Returns The domain_name.
350 351 352 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 350 def domain_name @properties['domain_name'] end |
#domain_suffix ⇒ String
Returns The domain_suffix.
344 345 346 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 344 def domain_suffix @properties['domain_suffix'] end |
#fetch ⇒ EnvironmentInstance
Fetch a EnvironmentInstance
381 382 383 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 381 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
408 409 410 411 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 408 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.EnvironmentInstance #{values}>" end |
#links ⇒ String
Returns The links.
374 375 376 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 374 def links @properties['links'] end |
#service_sid ⇒ String
Returns The service_sid.
326 327 328 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 326 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The sid.
314 315 316 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 314 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
401 402 403 404 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 401 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.EnvironmentInstance #{values}>" end |
#unique_name ⇒ String
Returns The unique_name.
338 339 340 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 338 def unique_name @properties['unique_name'] end |
#url ⇒ String
Returns The url.
368 369 370 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 368 def url @properties['url'] end |
#variables ⇒ variables
Access the variables
388 389 390 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment.rb', line 388 def variables context.variables end |